Skip to content

Prefix support #77

Open
Open
@sveredyuk

Description

Hi, I am actively using PG schemas and prefix options for Repo.insert(%{}, prefix: "my_shema") in my current multi-tenant application. Any plans on support the prefix option for schema? I can contribute if you are open.

Currently, I can add versions inside every schema, and it works fine on insert and update, but for delete, I got the trouble:

** (Postgres.Error) ERROR 42P01 (undefined_table) relation "versions" does not exist

    query: INSERT INTO "versions" ("account_id","action","entity_id","entity_schema","id","patch","recorded_at") VALUES ($1,$2,$3,$4,$5,$6,$7)
    (ecto_sql 3.6.2) lib/ecto/adapters/sql.ex:760: Ecto.Adapters.SQL.raise_sql_call_error/1
    (ecto_sql 3.6.2) lib/ecto/adapters/sql.ex:667: Ecto.Adapters.SQL.insert_all/9
    (ecto 3.6.2) lib/ecto/repo/schema.ex:58: Ecto.Repo.Schema.do_insert_all/7
    (ex_audit 0.9.0) lib/repo/schema.ex:72: anonymous fn/4 in ExAudit.Schema.delete/4
    (ex_audit 0.9.0) lib/repo/schema.ex:155: ExAudit.Schema.run_in_multi/4
    (ecto 3.6.2) lib/ecto/multi.ex:716: Ecto.Multi.apply_operation/5
    (elixir 1.12.1) lib/enum.ex:2356: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ecto 3.6.2) lib/ecto/multi.ex:690: anonymous fn/5 in Ecto.Multi.apply_operations/5
    (ecto_sql 3.6.2) lib/ecto/adapters/sql.ex:1017: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4

Maybe somehow it's possible to disable delete tracking for now? I can also contribute these options as well.

p.s. Thanks for doing this amazing open-source solution that should simplify my work a lot

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions