queryit
queryit copied to clipboard
Please add more support for mysql
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 gotUnhandled 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 (welladapter: mysql2
from rails db config file) withqueryit
? (I installedmysql-client
, and that seemed to work for the belowqueryit --uri ...
comand line approach; but my Railsdatabase.yml
usesadapter: 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 formysql
... theuri
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 thequeryit
app TUI opened and showed a connection to my db. I could run a query via pressingF5
and typingshow tables;
and then pressingF5
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).
- This (kinda) worked for me: