erlangbureau / jamdb_oracle

Oracle Database driver for Erlang
MIT License
106 stars 48 forks source link

Extracting constraint names #155

Closed dfrese closed 10 months ago

dfrese commented 1 year ago

Constraints are currently not extracted from Oracle-Errors.

in `jamdb_oracle_query.ex':

  def to_constraints(_err, _opts \\ []), do: []

So unique_constraint, no_assoc_constraint, foreign_key_constraint and check_constraint from Ecto.Changeset don't work.

dfrese commented 1 year ago

I implemented something matching the error messages I got from Oracle 19c EE, and will try to make a pull request.

I extracted the names 1:1 as Oracle returns them, which usually does not match the names generated by Ecto: Oracle always adds the Schema/User, and also all uppercase. That's inconvenient, but I did not want to implement something opinionated. At least this works if the constraint names are explicitly given via the name: option to the Ecto.Changeset functions, and optionally match: :suffix.

vstavskyi commented 1 year ago

Check stage branch

Create jamdb_oracle_sql.ex defdelegates