Lindenii Project Forge
Warning: Due to various recent migrations, viewing non-HEAD refs may be broken.
/pq/ffi/result.ha (raw)
use types::c;
export type result = opaque;
export @symbol("PQclear") fn clear(res: *result) void;
export @symbol("PQnfields") fn nfields(res: *result) int;
export @symbol("PQfname") fn fname(res: *result, field_num: int) *c::char;
export @symbol("PQntuples") fn ntuples(res: *result) int;
export @symbol("PQgetvalue") fn getvalue(res: *result, tup_num: int, field_num: int) *c::char;
export @symbol("PQgetlength") fn getlength(res: *result, tup_num: int, field_num: int) int;
export type ExecStatusType = enum int {
EMPTY_QUERY = 0,
COMMAND_OK,
TUPLES_OK,
COPY_OUT,
COPY_IN,
BAD_RESPONSE,
NONFATAL_ERROR,
FATAL_ERROR,
COPY_BOTH,
SINGLE_TUPLE,
PIPELINE_SYNC,
PIPELINE_ABORTED,
TUPLES_CHUNK,
};
export @symbol("PQresultStatus") fn resultStatus(res: *result) ExecStatusType;