-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Implement ColumnType interface #495
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
Comments
I have an immediate need for this functionality in a small project I am working on, so I hacked together a partial, very rough implementation for the single interface I need: hasryan@f2e81dd When I was working on that I noticed that empty results are represented by the My use case is one where I am executing ad-hoc queries against MySQL and replicating the results into another database (SQLite in my case). I need the type information from MySQL so that I can create appropriately-typed columns in the SQLite table I generate. An empty resultset is valid, and I would like to be able to create an empty table with correctly-typed columns. |
This i also something I would find very useful (working on MySQL data source support in Grafana where I need to visualize ad-hoc SQL queries in different forms) and knowing column types is going to be very important. @hasryan any plans to open a PR for your implementation? |
@torkelo sorry for not responding sooner. I do not have any immediate plans to open a PR because I suspect my referenced implementation is not up to to the quality standards of this project. It's something I put together that worked for me in my specific use case, but I have not had enough time to review the codebase to know if it is consistent with existing patterns. Also, I only implemented one of the five new interfaces. |
This is a temporary move until the columntype branch lands upstream. Implementation here: go-sql-driver#495
The latest master implements the ColumnType interface. See go-sql-driver/mysql#495 This removes the custom code in the vendor folder that did a ColumnType mapping.
See golang/go@2a85578 and golang/go#16652
The text was updated successfully, but these errors were encountered: