You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Ruby on Rails project supports a range of databases including SQLite. It uses DSL to manage database migrations so that you can write the migration once and expect it to work when you plug a different database in.
In the DSL for columns holding timestamps it sets the type to datetime. When I plug in a SQLite database the column type for timestamp columns is still recorded as datetime even though SQLite database only supports text (Rails does some magic with SQLite adapter to make a conversion behind the scenes).
sq inspect '@cp.users' -v
NAME TYPE ROWS COLS NAME TYPE PK
users table 10 7 id INTEGER pk
first_name varchar
last_name varchar
email varchar
activated boolean
created_at datetime(6)
updated_at datetime(6)
When using sq and I try to read these sqlite 'timestamp' fields in these fields I get the following error:
sq: query against @cp: sql: Scan error on column index 5, name "created_at": unsupported Scan, storing driver.Value type string into type *time.Time
Describe the solution you'd like
This is really an issue with Rails implementation. However, it would be nice for me, but also maybe for others (but mainly me) if there was an escape hatch so that I could specify type for the column in an argument.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Ruby on Rails project supports a range of databases including SQLite. It uses DSL to manage database migrations so that you can write the migration once and expect it to work when you plug a different database in.
In the DSL for columns holding timestamps it sets the type to datetime. When I plug in a SQLite database the column type for timestamp columns is still recorded as datetime even though SQLite database only supports text (Rails does some magic with SQLite adapter to make a conversion behind the scenes).
When using
sq
and I try to read these sqlite 'timestamp' fields in these fields I get the following error:Describe the solution you'd like
This is really an issue with Rails implementation. However, it would be nice for me, but also maybe for others (but mainly me) if there was an escape hatch so that I could specify type for the column in an argument.
The text was updated successfully, but these errors were encountered: