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.
(cancel-copy! copy-op)Abort an in-progress COPY operation (CopyIn, CopyOut, or CopyDual).
Abort an in-progress COPY operation (CopyIn, CopyOut, or CopyDual).
(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!`.
(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.
(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.
(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.
(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.
(flush-copy! copy-in)Flush buffered COPY data on an in-progress CopyIn.
Flush buffered COPY data on an in-progress `CopyIn`.
(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.
(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!`).
(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.
(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`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |