-
Notifications
You must be signed in to change notification settings - Fork 345
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
Feature: Column metadata harmonized with row result metadata #359
Comments
I'm not sure what the request is here? For what it's worth, how Go "sees" the types of those columns isn't what you want |
Consider JDBC for example. There the metadata is mapped to an external JDBC type system and then all client tools can use that rather than that each client tool must map to all possible databases. I realize this might be a bit out of scope for a pure terminal-based front-end like usql. Unless if you want to add a data migration tool. The The implementation at least for postgres is rather trivial: |
If you want to extract metadata about tables or queries from a SQL database, please use my Also, I'm still not sure what the feature request is? If it's easier to explain with code, we're always open to PRs! |
I'm working on a sql federated query engine. That is, a database without storage engine. So one needs to connect to other databases to fetch the data. Naturally many different databases should be supported so to stay sane some abstraction is needed. usql seemed to have the part of the metadata: golang/go#7408 (comment) In the same thread we have the exact feature request I was looking for: golang/go#7408 (comment) but shot down for inclusion in standard go. I'll take a look at xo tool as well as schema: |
After quick investigation of real implementations, I realize that This is quite a bit far out to ask from you. I close this issue. However, I still believe usql has the best approach to this. I'll see if I can get a PR on it. Sorry for taking up your time. |
The The When I was writing the metadata API, I knew it might be used outside of I'd suggest the following course of action. You can continue evaluating it, and I'd be grateful for any bug reports. If you have any major feature requests, we should consider creating a standalone repo to provide it as a library. That doesn't mean any changes in I'm interested in improving this API and also adding support for more databases, from which To wrap this up, I invite you to our Discord where it might be easier to discuss ideas. I'm very glad for the feedback you're providing. |
Thanks for the feedback and help. Much appreciated. I'll take a stab at it. |
database/sql
forces drivers to use the ColumnType for query return metadata.This is also used internally in usql.
Would it be possible to ask the column metadata from usql to also be able to conform to this format? Or at lease an extension point so that it can be done in userland? JDBC, ODBC, etc already have this mapping.
The drivers are forced to implement this conversion so if should not be too difficult. I could possibly volunteer:-).
This is useful when migrating from one database to another and for external tools. Also I understand this might not be a priority for the usql tool itself.
The text was updated successfully, but these errors were encountered: