When not using strict schema mode columns can be created with DateTime as a valid type in Sqlite. ORM's and schema generation tools like gorm & sqlc map this DateTime to golang's time.Time type. This type is then provided directly to libsql to build the query.
But there is no support for mapping this type.
Example schema
CREATE TABLE IF NOT EXISTS bookmarks (
description VARCHAR(255) NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL
);
Questions?
Should the recommendation be that strict mode is used on table creation to stop ORM's from mapping to unsupported type?
Should libsql support more primitive golang types and convert them to sqlite base types?
Description
When not using
strict
schema mode columns can be created withDateTime
as a valid type in Sqlite. ORM's and schema generation tools likegorm
&sqlc
map thisDateTime
to golang'stime.Time
type. This type is then provided directly tolibsql
to build the query.But there is no support for mapping this type.
Example schema
Questions?
strict
mode is used on table creation to stop ORM's from mapping to unsupported type?