queryit icon indicating copy to clipboard operation
queryit copied to clipboard

Please add more support for mysql

Open drhuffman12 opened this issue 3 years ago • 0 comments

Mysql support (split out of issue https://github.com/hugopl/queryit/issues/1) The uri is defined my mysql at: https://dev.mysql.com/doc/dev/mysqlsh-api-python/8.0/connection_data.html as [scheme://][user[:password]@]<host[:port]|socket>[/schema][?option=value&option=value...]

This is where I could use some help with connecting to mysql db and mysql datatype issues... I had issues trying to connect to a mysql db and didn't how to map rails 'adapters' to correct db clients (i.e.: tell queryit what db client to use per rails 'adapter' setting).

  • Running just queryit, I got Unhandled exception: no driver was registered for the schema "mysql2", did you maybe forget to require the database driver? (ArgumentError). What do I need to do to enable mysql (well adapter: mysql2 from rails db config file) with queryit? (I installed mysql-client, and that seemed to work for the below queryit --uri ... comand line approach; but my Rails database.yml uses adapter: mysql2, which leads me to the ... no driver was registered for the schema "mysql2" ... error.)

  • Next, I tried queryit --uri postgres://localhost/database part, but trying to connect to a mysql db, so for mysql ... the uri is defined my mysql at: https://dev.mysql.com/doc/dev/mysqlsh-api-python/8.0/connection_data.html as [scheme://][user[:password]@]<host[:port]|socket>[/schema][?option=value&option=value...].

    • This (kinda) worked for me: queryit --uri mysql://user:password@host:port/schema. By "(kinda) worked", I mean that the queryit app TUI opened and showed a connection to my db. I could run a query via pressing F5 and typing show tables; and then pressing F5 to execute. But, for some data types in some queries, I got errors (e.g.: Invalid time, varchar fields don't seem to show up as blanks in the results column).

drhuffman12 avatar Aug 28 '21 03:08 drhuffman12