# `PgLargeObjects.Repo`
[🔗](https://github.com/frerich/pg_large_objects/blob/main/lib/pg_large_objects/repo.ex#L1)

Extension API for Ecto.Repo.

This exposes convenience APIs on an application's Ecto repository module such
that explicitly passing the name of the repository to different APIs is no
longer necessary.

The module is meant to be referenced via `use`, as in:

```elixir
defmodule MyApp.Repo do
  use Ecto.Repo,
    otp_app: :my_app,
    adapter: Ecto.Adapters.Postgres

  use PgLargeObjects.Repo
end
```

Doing so causes the following convenience functions to be defined on the repository module:

* `import_large_object(data, opts)` - shortcut for `PgLargeObjects.import/3`.
* `export_large_object(oid, opts)` - shortcut for `PgLargeObjects.export/3`.
* `create_large_object/1` - shortcut for `PgLargeObjects.LargeObject.create/2`.
* `open_large_object/1` - shortcut for `PgLargeObjects.LargeObject.open/3`.
* `remove_large_object/1` - shortcut for `PgLargeObjects.LargeObject.remove/2`.

Furthermore, a type `t` is defined in the current module. In case this is not
desirable, e.g. because a type is already defined, pass the option
`omit_typespec: true`.

---

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