CopyManager

class CopyManager(stream: PgStream, queryExecutor: QueryExecutor)

Manages COPY IN and COPY OUT operations for a specific connection stream.

A COPY starts on the stream directly rather than through an exchange of queryExecutor, so it is the one place that has to ask for a waiting BEGIN itself: with auto-commit off, a COPY can be what begins the transaction.

Constructors

Link copied to clipboard
internal constructor(stream: PgStream, queryExecutor: QueryExecutor)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun copyIn(sql: String): CopyIn

Initiates a COPY IN operation allowing manual chunk writing.

fun copyIn(sql: String, inputStream: InputStream, bufferSize: Int = DEFAULT_BUFFER_SIZE): Long

Reads all data from the provided InputStream and writes it to the COPY IN operation.

Link copied to clipboard

Initiates a COPY OUT operation allowing manual chunk reading.

fun copyOut(sql: String, outputStream: OutputStream): Long

Reads all data from the COPY OUT operation and writes it to the provided OutputStream.