Method

PgsqlConnectioncopy_in

Declaration

DexFuture*
pgsql_connection_copy_in (
  PgsqlConnection* self,
  const char* sql,
  GInputStream* input_stream
)

Description

Executes a COPY FROM STDIN operation on the connection.

This function sends the provided SQL statement, which must be a valid COPY ... FROM STDIN statement (including COPY (SELECT ...) FROM STDIN variants). It then reads data from input_stream and sends it to the server until EOF is reached.

Parameters

sql

Type: const char*

The COPY FROM STDIN SQL statement.

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
input_stream

Type: GInputStream

A GInputStream to read data from.

The data is owned by the caller of the method.

Return value

Type: DexFuture

A DexFuture that resolves when the COPY operation completes successfully, or rejects with error.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.