-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathquery.ts
26 lines (24 loc) · 1.05 KB
/
query.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { Writable } from 'node:stream';
import { DataFormat, DataType } from './types.js';
export interface QueryOptions {
/** The query name. */
readonly name: string;
/** Whether to use the default portal (i.e. unnamed) or provide a name. */
readonly portal: string;
/** Allows making the database native type explicit for some or all columns. */
readonly types: DataType[];
/** Whether column data should be transferred using text or binary mode. */
readonly format: DataFormat | DataFormat[];
/** A mapping from column name to a socket, e.g. an open file. */
readonly streams: Record<string, Writable>;
/** Allows the transformation of column names as returned by the database. */
readonly transform: (name: string) => string;
/** Use bigint for the INT8 (64-bit integer) data type. */
readonly bigints: boolean;
}
/**
* A query parameter can be used in place of a query text as the first argument
* to the {@link Client.query} method.
* @interface
*/
export type Query = Partial<QueryOptions> & { text: string };