Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify https://dash/api/data_sources/3/schema API to be more extensible. #2553

Open
epankala opened this issue May 24, 2018 · 0 comments
Open

Comments

@epankala
Copy link

It would be nice if schemabrowser would be able to display extra information on the page and be configurable per data source.

For example column type (BIGINT, TIMESTAMP, ...) would be nice information to pass to the browser.

Current schema API returns payload like

--
{
"schema": [ {
"name": "admin.v_check_data_distribution",
"columns": [
"slice",
"schema_oid",
"schemaname",
"tbl_oid",
"tablename",
"rowcount_on_slice",
"total_rowcount",
"distrib_pct",
"min_distrib_pct",
"max_distrib_pct"
] }, {
"name": "admin.v_check_transaction_locks",
"columns": [
"system_ts",
"schemaname",
"tablename",
"databasename",
"transaction",
"pid",
"usename",
"mode",
"granted"
] },
...

This does not allow for much extra information to be passed per column.

I would like to propose something along the lines of

{
"schema": {
"tables": [ { "name": "tableX",
"columns": [ { "name": "column1", "type": "TIMESTAMP" },
{ "name": "column2", "type": "BIGINT" }
]}],
"optionalConfigurationOptionsEtc": { "schemaFilter": "public\..*" },
"somextradatainthefuture": { object }
}
}

This would give possibility to provide more information per column (perhaps even description or something else in addition to column type).

Also it would be possible to return data that is not schema data, but could perhaps be schemabrowser configuration options.

eg. currently we would have a need to provide a 'default' schema filter per data source which could be locally altered /session by the user.

If it would be configured in the data source settings it could be provided by schema API to the clients.

As we are using redash internally and are in need of some features like this we have now possibility to try and contribute something back.
Or if such features are not desired or are already coming we can make a local quick hack or wait.

If there is need for this kind of modification I'd like to inquire for information on how to go about implementing it so it would have possibility to be merged for upstream.

ie should the API be https://dash/api/data_sources/3/schema_v2 or just change the existing one etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants