elixir-sqlite / sqlite_ecto2

Sqlite3 adapter for Ecto 2.2.x
https://hex.pm/packages/sqlite_ecto2
MIT License
120 stars 33 forks source link

UPSERT with ON CONFLICT #225

Closed venkatd closed 5 years ago

venkatd commented 6 years ago

It looks like as of 3.24, sqlite3 supports ON CONFLICT UPDATE that mimics the postgres syntax: https://www.sqlite.org/lang_UPSERT.html

I saw that https://github.com/mmzeeman/esqlite has updated to 3.24 at least on the master branch.

I'm a newbie to the Ecto internals so if someone is able to point me in the right direction, I can take a stab at implementing this.

UPSERT will be very useful to us so we can treat sqlite as a key-value store.

ConnorRigby commented 6 years ago

We follow releases of esqlite, so when it is released i will investigate integrating UPSERTs with Ecto. For what it's worth if you want to take a look, you can add {:esqlite, github: "mmzeeman/esqlite", override: true, manager: :rebar3} to your deps. this is likely the function that will need to be updated.

ConnorRigby commented 6 years ago

and here is the postgrex implementation

venkatd commented 6 years ago

@ConnorRigby thanks for the pointers.

ConnorRigby commented 5 years ago

Closed by #233