# `BullMQ.Backends.Postgres.SqlLoader`
[🔗](https://github.com/taskforcesh/bullmq/blob/v2.2.3/lib/bullmq/backends/postgres/sql_loader.ex#L1)

Loads the PostgreSQL backend's SQL from `.sql` files — the portable source of
truth shared with the Node.js/Python/other ports.

Runtime queries live under `postgres/commands/` (each file is one
parameterized `SELECT fn(...)` or direct statement); schema migrations live
under `postgres/migrations/`. The files contain **no** schema/namespace
references — the connection's `search_path` selects the schema — so they are
portable verbatim.

Like `BullMQ.Scripts` (which prefers `priv/scripts` and falls back to the
repo's `rawScripts`), this loader prefers `priv/postgres` and falls back to
the shared `src/postgres` tree during local development. Results are cached in
`:persistent_term` after the first read.

# `base_dir`

```elixir
@spec base_dir() :: String.t()
```

Returns the base directory the SQL is loaded from (priv or src).

# `load_command`

```elixir
@spec load_command(String.t()) :: String.t()
```

Loads a runtime command's SQL by name (without the `.sql` extension).

# `load_migration`

```elixir
@spec load_migration(String.t()) :: String.t()
```

Loads a migration's SQL by file name (with the `.sql` extension).

---

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