Mailglass.Credo.RawRepoPrefixContract (Mailglass v2.2.2)

Copy Markdown View Source

Basics

This check is disabled by default.

Learn how to enable it via .credo.exs.

This check has a base priority of high and works with any version of Elixir.

Explanation

Raw callback repos and Ecto.Multi projection updates that touch mailglass tables must carry explicit schema prefix opts. Use Repo.multi_opts(), local schema_opts(), or a literal prefix: option.

Check-Specific Parameters

Use the following parameters to configure this check:

:included_path_prefixes

Only production files under these prefixes are linted.

This parameter defaults to ["lib/mailglass/", "mailglass_inbound/lib/"].

:schema_modules

Mailglass schemas treated as schema-prefix-sensitive.

This parameter defaults to [Mailglass.Outbound.Delivery, Mailglass.Events.Event, Mailglass.Suppression.Entry, Mailglass.Webhook.WebhookEvent, MailglassInbound.InboundRecords.InboundRecord, MailglassInbound.InboundRecords.InboundEvidence, MailglassInbound.InboundRecords.ExecutionRun, MailglassInbound.InboundRecords.ReplayRun].

:table_sources

String table sources treated as schema-prefix-sensitive.

This parameter defaults to [core: ["mailglass_deliveries", "mailglass_events", "mailglass_suppressions", "mailglass_webhook_events"], inbound: ["mailglass_inbound_records", "mailglass_inbound_evidence", "mailglass_inbound_replay_runs"]].

:repo_functions

Lowercase raw repo functions treated as table access.

This parameter defaults to [:one, :one!, :get, :get!, :get_by, :get_by!, :all, :aggregate, :exists?, :insert, :insert!, :insert_all, :update, :update!, :update_all, :delete, :delete!, :delete_all].

:multi_functions

Ecto.Multi functions that can update projections.

This parameter defaults to [:insert, :insert_all, :update, :update_all, :delete, :delete_all].

:projection_steps

Multi step names known to update mailglass projections.

This parameter defaults to [:delivery, :projection].

:prefix_helper_functions

Local helper functions that return explicit prefix opts.

This parameter defaults to [:schema_opts, :insert_opts].

General Parameters

Like with all checks, general params can be applied.

Parameters can be configured via the .credo.exs config file.