Liking cljdoc? Tell your friends :D

psql.largeobject

PostgreSQL large-object (lo) helpers over pgjdbc's LargeObjectManager.

Large objects are stored in pg_largeobject and addressed by an OID. Every operation must run inside a transaction (set autocommit off, e.g. with next.jdbc/with-transaction); pgjdbc raises otherwise. Each function accepts the java.sql.Connection for manager operations, or an open LargeObject for read/write/seek. The caller owns the connection and transaction lifecycle.

PostgreSQL large-object (`lo`) helpers over pgjdbc's `LargeObjectManager`.

Large objects are stored in `pg_largeobject` and addressed by an OID. Every
operation must run inside a transaction (set autocommit off, e.g. with
`next.jdbc/with-transaction`); pgjdbc raises otherwise. Each function accepts
the `java.sql.Connection` for manager operations, or an open `LargeObject` for
read/write/seek. The caller owns the connection and transaction lifecycle.
raw docstring

close!clj

(close! lo)

Close an open LargeObject.

Close an open LargeObject.
sourceraw docstring

create!clj

(create! conn)

Create a new, empty large object and return its OID (a long).

Create a new, empty large object and return its OID (a long).
sourceraw docstring

fetchclj

(fetch conn oid)

Read the entire contents of the large object OID as a byte array.

Read the entire contents of the large object OID as a byte array.
sourceraw docstring

input-streamclj

(input-stream lo)

Return an InputStream reading LO from its current position.

Return an `InputStream` reading LO from its current position.
sourceraw docstring

lo-sizeclj

(lo-size lo)

Return the size of LO in bytes.

Return the size of LO in bytes.
sourceraw docstring

managerclj

(manager conn)

Return pgjdbc's LargeObjectManager for an open connection.

Return pgjdbc's `LargeObjectManager` for an open connection.
sourceraw docstring

openclj

(open conn oid)
(open conn oid mode)

Open the large object OID and return a LargeObject. MODE is :read, :write, or :read-write (default :read-write). Close it with close!.

Open the large object OID and return a `LargeObject`. MODE is `:read`,
`:write`, or `:read-write` (default `:read-write`). Close it with `close!`.
sourceraw docstring

output-streamclj

(output-stream lo)

Return an OutputStream writing to LO at its current position.

Return an `OutputStream` writing to LO at its current position.
sourceraw docstring

read-bytesclj

(read-bytes lo n)

Read up to N bytes from LO at the current position, as a byte array.

Read up to N bytes from LO at the current position, as a byte array.
sourceraw docstring

seek!clj

(seek! lo pos)
(seek! lo pos whence)

Move LO's read/write position to POS bytes, relative to WHENCE (:set, :cur, or :end; default :set).

Move LO's read/write position to POS bytes, relative to WHENCE (`:set`,
`:cur`, or `:end`; default `:set`).
sourceraw docstring

store!clj

(store! conn data)

Create a large object, write DATA (a byte array) into it, and return its OID. Runs against CONN's current transaction.

Create a large object, write DATA (a byte array) into it, and return its OID.
Runs against CONN's current transaction.
sourceraw docstring

tellclj

(tell lo)

Return LO's current byte position.

Return LO's current byte position.
sourceraw docstring

truncate!clj

(truncate! lo length)

Truncate LO to LENGTH bytes.

Truncate LO to LENGTH bytes.
sourceraw docstring

unlink!clj

(unlink! conn oid)

Delete the large object with OID.

Delete the large object with OID.
sourceraw docstring

write-bytes!clj

(write-bytes! lo data)
(write-bytes! lo data offset length)

Write a byte array to LO at the current position (optionally a sub-range).

Write a byte array to LO at the current position (optionally a sub-range).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close