imdrasil / jennifer_sqlite3_adapter

SQLite3 adapter for Jennifer ORM
MIT License
13 stars 7 forks source link

Add all dynamic container types #37

Closed SebastianSzturo closed 2 years ago

SebastianSzturo commented 2 years ago

While porting some of my Rails' app code I've noticed that the SQLite3 adapter defined a time type while the actual Jennifer code only supports a t.date_time method. (Fixed in https://github.com/imdrasil/jennifer_sqlite3_adapter/pull/38)

Looking at the other TYPE_TRANSLATIONS it seems like the adapter is currently only mapping to the underlying storage classes and not SQLite's container types. This makes us miss out on many of the amazing SQLite3 query features around those types without explicitly casting.

This PR is mapping all types to their container types adapted from the Rails' SQLite3Adapter implementation: https://github.com/rails/rails/blob/main/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb/#L64-L77

This might be a breaking change for existing schema, so it might require a major version bump.

imdrasil commented 2 years ago

Hi, great job :+1: I've returned your text fixes back as in CI and locally on my machine I have other behavior - looks like your instance is somehow different