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

Extensions to Ecto's query DSL.

Import this module to make various macros available wrapping the raw
PostgreSQL API for dealing with large objects.

This permits operating on large objects in bulk as part of SQL queries. For
example

```elixir
import Ecto.Query
import PgLargeObjects.EctoQuery

# Delete all data uploaded by a given user.
from(upload in Upload,
  where: upload.user_id == ^user_id,
  select: lo_unlink(upload.object_id)
) |> Repo.all()
```

See the PostgreSQL documentation at
https://www.postgresql.org/docs/current/lo-interfaces.html for a discussion
of these functions.

# `lo_close`
*macro* 

Close large object file descriptor.

See https://www.postgresql.org/docs/current/lo-interfaces.html#LO-CLOSE for details.

# `lo_create`
*macro* 

Create large object.

See https://www.postgresql.org/docs/current/lo-interfaces.html#LO-CREATE for details.

# `lo_lseek64`
*macro* 

Adjust read/write position in large object.

See https://www.postgresql.org/docs/current/lo-interfaces.html#LO-SEEK for details.

# `lo_open`
*macro* 

Open large object for reading or writing.

See https://www.postgresql.org/docs/current/lo-interfaces.html#LO-OPEN for details.

# `lo_read`
*macro* 

Read data from large object.

See https://www.postgresql.org/docs/current/lo-interfaces.html#LO-READ for details.

# `lo_tell64`
*macro* 

Get read/write position of large object.

See https://www.postgresql.org/docs/current/lo-interfaces.html#LO-TELL for details.

# `lo_truncate64`
*macro* 

Truncate or expand large object.

See https://www.postgresql.org/docs/current/lo-interfaces.html#LO-TRUNCATE for details.

# `lo_unlink`
*macro* 

Delete large object.

See https://www.postgresql.org/docs/current/lo-interfaces.html#LO-UNLINK for details.

# `lo_write`
*macro* 

Write data to large object.

See https://www.postgresql.org/docs/current/lo-interfaces.html#LO-WRITE for details.

---

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