Skip to content

improvement: support {:unsafe_fragment, ".."} as a conflict target#129

Merged
warmwaffles merged 1 commit into
elixir-sqlite:mainfrom
zachdaniel:unsafe-fragment-conflict-target
Oct 10, 2023
Merged

improvement: support {:unsafe_fragment, ".."} as a conflict target#129
warmwaffles merged 1 commit into
elixir-sqlite:mainfrom
zachdaniel:unsafe-fragment-conflict-target

Conversation

@zachdaniel
Copy link
Copy Markdown
Contributor

this is supported by other sql data layers, for example. This is necessary for AshSqlite3's upsert behavior. Postgres adapter implementation: https://github.com/elixir-ecto/ecto_sql/blob/v3.10.2/lib/ecto/adapters/postgres/connection.ex#L212C4-L213C26

Comment thread lib/ecto/adapters/sqlite3/connection.ex
@zachdaniel zachdaniel force-pushed the unsafe-fragment-conflict-target branch from 7b97dce to d03824e Compare October 10, 2023 19:00
@warmwaffles
Copy link
Copy Markdown
Member

This looks good. I'll merge it once CI passes. It would be nice to have a test added for this. I don't know if there are unsafe fragment tests in the integration suite provided by ecto_sql and ecto.

@zachdaniel
Copy link
Copy Markdown
Contributor Author

👍 will add one

@zachdaniel zachdaniel force-pushed the unsafe-fragment-conflict-target branch from d03824e to fe54500 Compare October 10, 2023 19:18
this is supported by other sql data layers, for example. This is necessary for AshSqlite3's upsert behavior.
Postgres adapter implementation: https://github.com/elixir-ecto/ecto_sql/blob/v3.10.2/lib/ecto/adapters/postgres/connection.ex#L212C4-L213C26
@zachdaniel zachdaniel force-pushed the unsafe-fragment-conflict-target branch from fe54500 to d6d5f11 Compare October 10, 2023 19:19
@zachdaniel
Copy link
Copy Markdown
Contributor Author

Alright, added a test :)

@warmwaffles warmwaffles merged commit e99c33d into elixir-sqlite:main Oct 10, 2023
@warmwaffles
Copy link
Copy Markdown
Member

Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants