elixir-sqlite / ecto_sqlite3

An Ecto SQLite3 adapter.
https://hexdocs.pm/ecto_sqlite3
MIT License
299 stars 45 forks source link

Missing literal, selected_as and using CAST for floats. #100

Closed jeregrine closed 1 year ago

jeregrine commented 1 year ago

I was playing around some queries and noticed literals and selected_as was not implemented.

I also saw the comment about being unsure about floats so I just read the guide and it has CAST as if we know the type. I chose REAL but it looks like FLOAT would also work LMK if you think I should change it.

jeregrine commented 1 year ago

FYI @josevalim has convinced me to try and port the current postgres/mysql connection tests to current sqlite since they appear to be an original fork from the first time this was tried. I won't include that here but something to keep in mind.

warmwaffles commented 1 year ago

has convinced me to try and port the current postgres/mysql connection tests to current sqlite since they appear to be an original fork from the first time this was tried.

@jeregrine that would be awesome! I will not say no to fixes and more tests 😄

jeregrine commented 1 year ago

I have a small WIP where I copied the postgres connection tests over to this repo from ecto_sql and ported them. I put a bunch of TODO in places we should probably raise.

And for sure missed some others from the connection test you added in addition to the postgres specific tests.

https://github.com/elixir-sqlite/ecto_sqlite3/compare/main...jeregrine:js/pg-connection-test?expand=1

warmwaffles commented 1 year ago

I missed that the JSON type with strict mode that we are wanting to enforce is not a valid type.

jeregrine commented 1 year ago

haha you're all good, sqlite is super permissive haha.

warmwaffles commented 1 year ago

sqlite is super permissive

Which is why I didn't initially jump on the strict typing. I liked the flexibility, but it's probably smarter to be more strict.

jeregrine commented 1 year ago

https://github.com/elixir-sqlite/ecto_sqlite3/pull/101 discussion here