# `PhoenixKit.RepoHelper`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.87/lib/phoenix_kit/repo_helper.ex#L1)

Helper for dynamically resolving the repository to use.

This module provides functions to get the appropriate repository
based on configuration. It will use the configured repo from
the parent application if available, otherwise fall back to
the built-in PhoenixKit.Repo for development/testing.

# `aggregate`

Delegates to the configured repo's aggregate function.

# `all`

Delegates to the configured repo's all function.

# `delete`

Delegates to the configured repo's delete function.

# `delete_all`

Delegates to the configured repo's delete_all function.

# `exists?`

Delegates to the configured repo's exists? function.

# `get`

Delegates to the configured repo's get function.

# `get!`

Delegates to the configured repo's get! function.

# `get_by`

Delegates to the configured repo's get_by function.

# `get_pk_column`

Returns the primary key column name for a given table.

Queries `pg_index` to find the actual PK column. Falls back to `"id"` if
the PK cannot be determined (e.g. table doesn't exist or has a composite PK).

# `insert`

Delegates to the configured repo's insert function.

# `insert!`

Delegates to the configured repo's insert! function.

# `one`

Delegates to the configured repo's one function.

# `preload`

Delegates to the configured repo's preload function.

# `query`

Delegates to the configured repo's query function.

# `query!`

Delegates to the configured repo's query! function.

# `repo`

Gets the repository module to use.

Expects repo to be configured via PhoenixKit.Config.get(:repo).
Raises an error if no repo is configured.

# `rollback`

Delegates to the configured repo's rollback function.

This function is used within transactions to rollback and return an error value.

# `transaction`

Delegates to the configured repo's transaction function.

# `update`

Delegates to the configured repo's update function.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
