Liking cljdoc? Tell your friends :D

psql.copy

PostgreSQL COPY helpers that use pgjdbc's CopyManager.

COPY runs on a java.sql.Connection. The caller owns the connection and must keep it open for the COPY operation.

PostgreSQL COPY helpers that use pgjdbc's CopyManager.

COPY runs on a java.sql.Connection. The caller owns the connection and must keep it open for the COPY operation.
raw docstring

cancel-copy!clj

(cancel-copy! copy-op)

Abort an in-progress COPY operation (CopyIn, CopyOut, or CopyDual).

Abort an in-progress COPY operation (CopyIn, CopyOut, or CopyDual).
sourceraw docstring

copy-dualclj

(copy-dual conn sql)

Begin a bidirectional COPY and return a pgjdbc CopyDual handle. Used by the streaming replication protocol; write with write-copy! and read with read-copy!.

Begin a bidirectional `COPY` and return a pgjdbc `CopyDual` handle. Used by
the streaming replication protocol; write with `write-copy!` and read with
`read-copy!`.
sourceraw docstring

copy-inclj

(copy-in conn sql source)
(copy-in conn sql source chunk-size)

Run COPY SQL FROM STDIN with a Reader or InputStream. Return the row count.

The stream may contain text, CSV, or PostgreSQL binary COPY data. With a CHUNK-SIZE (bytes/chars per network buffer) the stream is sent in fixed-size chunks for backpressure control. The caller owns both the stream and the open connection lifecycle.

Run COPY SQL FROM STDIN with a Reader or InputStream. Return the row count.

The stream may contain text, CSV, or PostgreSQL binary COPY data. With a
CHUNK-SIZE (bytes/chars per network buffer) the stream is sent in fixed-size
chunks for backpressure control. The caller owns both the stream and the open
connection lifecycle.
sourceraw docstring

copy-managerclj

(copy-manager conn)

Return pgjdbc's CopyManager for an open PostgreSQL connection.

The caller owns the connection lifecycle; this function never closes it.

Return pgjdbc's CopyManager for an open PostgreSQL connection.

The caller owns the connection lifecycle; this function never closes it.
sourceraw docstring

copy-outclj

(copy-out conn sql destination)

Run COPY SQL TO STDOUT with a Writer or OutputStream. Return the row count.

Use an OutputStream for PostgreSQL binary COPY data. The caller owns both the stream and the open connection lifecycle.

Run COPY SQL TO STDOUT with a Writer or OutputStream. Return the row count.

Use an OutputStream for PostgreSQL binary COPY data. The caller owns both the
stream and the open connection lifecycle.
sourceraw docstring

end-copy!clj

(end-copy! copy-in)

Finish an in-progress CopyIn (or CopyDual) and return the server's row count.

Finish an in-progress `CopyIn` (or `CopyDual`) and return the server's row
count.
sourceraw docstring

flush-copy!clj

(flush-copy! copy-in)

Flush buffered COPY data on an in-progress CopyIn.

Flush buffered COPY data on an in-progress `CopyIn`.
sourceraw docstring

read-copy!clj

(read-copy! copy-out)

Read the next COPY data row from a CopyOut (or CopyDual) as a byte array, or nil when the stream is exhausted.

Read the next COPY data row from a `CopyOut` (or `CopyDual`) as a byte array,
or nil when the stream is exhausted.
sourceraw docstring

start-copy-inclj

(start-copy-in conn sql)

Begin COPY SQL FROM STDIN and return a pgjdbc CopyIn handle. Feed it with write-copy! and finish with end-copy! (or abort with cancel-copy!).

Begin `COPY SQL FROM STDIN` and return a pgjdbc `CopyIn` handle. Feed it with
`write-copy!` and finish with `end-copy!` (or abort with `cancel-copy!`).
sourceraw docstring

start-copy-outclj

(start-copy-out conn sql)

Begin COPY SQL TO STDOUT and return a pgjdbc CopyOut handle. Pull data with read-copy! until it returns nil.

Begin `COPY SQL TO STDOUT` and return a pgjdbc `CopyOut` handle. Pull data
with `read-copy!` until it returns nil.
sourceraw docstring

write-copy!clj

(write-copy! copy-in data)
(write-copy! copy-in data offset length)

Write COPY data to an in-progress CopyIn. DATA is a byte array (optionally a sub-range via OFFSET and LENGTH) or a pgjdbc ByteStreamWriter.

Write COPY data to an in-progress `CopyIn`. DATA is a byte array (optionally a
sub-range via OFFSET and LENGTH) or a pgjdbc `ByteStreamWriter`.
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