@prairielearn/postgres 6.0.1 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @prairielearn/postgres
2
2
 
3
+ ## 6.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 382dbd8: Bump dependencies
8
+
9
+ ## 6.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - e80a5a5: List direct dependencies explicitly
14
+ - b6e03e9: Upgrade dependencies
15
+
3
16
  ## 6.0.1
4
17
 
5
18
  ### Patch Changes
@@ -16,31 +16,31 @@ export declare const closeAsync: () => Promise<void>;
16
16
  * destruction of the client, but this should not be used except in
17
17
  * unusual circumstances.
18
18
  */
19
- export declare const getClientAsync: () => Promise<import("pg").PoolClient>;
19
+ export declare const getClientAsync: () => Promise<import("pg").default.PoolClient>;
20
20
  /**
21
21
  * Performs a query with the given client.
22
22
  */
23
- export declare const queryWithClientAsync: (client: import("pg").PoolClient, sql: string, params: QueryParams) => Promise<import("pg").default.QueryResult<any>>;
23
+ export declare const queryWithClientAsync: (client: import("pg").default.PoolClient, sql: string, params: QueryParams) => Promise<import("pg").default.QueryResult>;
24
24
  /**
25
25
  * Performs a query with the given client. Errors if the query returns more
26
26
  * than one row.
27
27
  */
28
- export declare const queryWithClientOneRowAsync: (client: import("pg").PoolClient, sql: string, params: QueryParams) => Promise<import("pg").default.QueryResult<any>>;
28
+ export declare const queryWithClientOneRowAsync: (client: import("pg").default.PoolClient, sql: string, params: QueryParams) => Promise<import("pg").default.QueryResult>;
29
29
  /**
30
30
  * Performs a query with the given client. Errors if the query returns more
31
31
  * than one row.
32
32
  */
33
- export declare const queryWithClientZeroOrOneRowAsync: (client: import("pg").PoolClient, sql: string, params: QueryParams) => Promise<import("pg").QueryResult<any>>;
33
+ export declare const queryWithClientZeroOrOneRowAsync: (client: import("pg").default.PoolClient, sql: string, params: QueryParams) => Promise<import("pg").QueryResult>;
34
34
  /**
35
35
  * Rolls back the current transaction for the given client.
36
36
  */
37
- export declare const rollbackWithClientAsync: (client: import("pg").PoolClient) => Promise<void>;
38
- export declare const beginTransactionAsync: () => Promise<import("pg").PoolClient>;
37
+ export declare const rollbackWithClientAsync: (client: import("pg").default.PoolClient) => Promise<void>;
38
+ export declare const beginTransactionAsync: () => Promise<import("pg").default.PoolClient>;
39
39
  /**
40
40
  * Commits the transaction if err is null, otherwise rollbacks the transaction.
41
41
  * Also releases the client.
42
42
  */
43
- export declare const endTransactionAsync: (client: import("pg").PoolClient, err: Error | null | undefined) => Promise<void>;
43
+ export declare const endTransactionAsync: (client: import("pg").default.PoolClient, err: Error | null | undefined) => Promise<void>;
44
44
  /**
45
45
  * Runs the specified function inside of a transaction. The function will
46
46
  * receive a database client as an argument, but it can also make queries
@@ -49,21 +49,21 @@ export declare const endTransactionAsync: (client: import("pg").PoolClient, err:
49
49
  * The transaction will be rolled back if the function throws an error, and
50
50
  * will be committed otherwise.
51
51
  */
52
- export declare const runInTransactionAsync: <T>(fn: (client: import("pg").PoolClient) => Promise<T>) => Promise<T>;
52
+ export declare const runInTransactionAsync: <T>(fn: (client: import("pg").default.PoolClient) => Promise<T>) => Promise<T>;
53
53
  /**
54
54
  * Calls a sproc with the specified parameters using a specific client.
55
55
  */
56
- export declare const callWithClientAsync: (client: import("pg").PoolClient, functionName: string, params: any[]) => Promise<import("pg").default.QueryResult<any>>;
56
+ export declare const callWithClientAsync: (client: import("pg").default.PoolClient, functionName: string, params: any[]) => Promise<import("pg").default.QueryResult>;
57
57
  /**
58
58
  * Calls a sproc with the specified parameters using a specific client.
59
59
  * Errors if the sproc does not return exactly one row.
60
60
  */
61
- export declare const callWithClientOneRowAsync: (client: import("pg").PoolClient, functionName: string, params: any[]) => Promise<import("pg").default.QueryResult<any>>;
61
+ export declare const callWithClientOneRowAsync: (client: import("pg").default.PoolClient, functionName: string, params: any[]) => Promise<import("pg").default.QueryResult>;
62
62
  /**
63
63
  * Calls a sproc with the specified parameters using a specific client.
64
64
  * Errors if the sproc returns more than one row.
65
65
  */
66
- export declare const callWithClientZeroOrOneRowAsync: (client: import("pg").PoolClient, functionName: string, params: any[]) => Promise<import("pg").default.QueryResult<any>>;
66
+ export declare const callWithClientZeroOrOneRowAsync: (client: import("pg").default.PoolClient, functionName: string, params: any[]) => Promise<import("pg").default.QueryResult>;
67
67
  /**
68
68
  * Executes a query with the specified parameters. Returns an array of rows
69
69
  * that conform to the given Zod schema.
@@ -1 +1 @@
1
- {"version":3,"file":"default-pool.d.ts","sourceRoot":"","sources":["../src/default-pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAEhF,QAAA,MAAM,WAAW,cAAqB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,CAAC;AAe9D;;GAEG;AACH,eAAO,MAAM,SAAS,gJAA0C,CAAC;AACjE;;GAEG;AACH,eAAO,MAAM,UAAU,qBAA2C,CAAC;AACnE;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,wCAA+C,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,oBAAoB,uHAAqD,CAAC;AAEvF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,uHAA2D,CAAC;AAEnG;;;GAGG;AACH,eAAO,MAAM,gCAAgC,+GACmB,CAAC;AACjE;;GAEG;AACH,eAAO,MAAM,uBAAuB,oDAAwD,CAAC;AAC7F,eAAO,MAAM,qBAAqB,wCAAsD,CAAC;AACzF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,mFAAoD,CAAC;AACrF;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,wEAAsD,CAAC;AACzF;;GAEG;AACH,eAAO,MAAM,mBAAmB,0HAAoD,CAAC;AACrF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,0HAA0D,CAAC;AACjG;;;GAGG;AACH,eAAO,MAAM,+BAA+B,0HACmB,CAAC;AAChE;;;GAGG;AACH,eAAO,MAAM,SAAS;;;CAA0C,CAAC;AACjE;;GAEG;AACH,eAAO,MAAM,QAAQ;;;CAAyC,CAAC;AAC/D;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;CAAiD,CAAC;AAC/E;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;CAAyC,CAAC;AAC/D;;;GAGG;AACH,eAAO,MAAM,OAAO;;;CAAwC,CAAC;AAC7D;;;GAGG;AACH,eAAO,MAAM,eAAe;;;CAAgD,CAAC;AAC7E;;;GAGG;AACH,eAAO,MAAM,YAAY;;;CAA6C,CAAC;AACvE;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;CAA4C,CAAC;AACrE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;CAAoD,CAAC;AACrF;;;GAGG;AACH,eAAO,MAAM,WAAW;;;CAA4C,CAAC;AACrE;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;CAA2C,CAAC;AACnE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;CAAmD,CAAC;AAEnF;;GAEG;AACH,eAAO,MAAM,OAAO,wDAAwC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,UAAU,sDAA2C,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;CAA4C,CAAC;AACrE;;;;GAIG;AACH,eAAO,MAAM,eAAe,0CAAgD,CAAC;AAC7E;;;;GAIG;AACH,eAAO,MAAM,eAAe,qBAAgD,CAAC;AAC7E;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,qCAA2D,CAAC;AAEnG;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,mCAAyD,CAAC","sourcesContent":["import { type CursorIterator, PostgresPool, type QueryParams } from './pool.js';\n\nconst defaultPool = new PostgresPool();\nexport { defaultPool, type CursorIterator, type QueryParams };\n\n// We re-expose all functions from the default pool here to account for the\n// default case of a shared global pool of clients. If someone want to create\n// their own pool, we expose the `PostgresPool` class.\n//\n// Note that we explicitly bind all functions to `defaultPool`. This ensures\n// that they'll be invoked with the correct `this` context, specifically when\n// this module is imported as `import * as db from '...'` and that import is\n// subsequently transformed by Babel to `interopRequireWildcard(...)`.\n\n// VSCode currently doesn't allow for us to use `inheritDoc` to inherit the\n// documentation from the `PostgresPool` class. We mirror the documentation\n// here for *async methods* in VSCode intellisense.\n\n/**\n * Creates a new connection pool and attempts to connect to the database.\n */\nexport const initAsync = defaultPool.initAsync.bind(defaultPool);\n/**\n * Closes the connection pool.\n */\nexport const closeAsync = defaultPool.closeAsync.bind(defaultPool);\n/**\n * Gets a new client from the connection pool. The caller MUST call `release()` to\n * release the client, whether or not errors occurred while using\n * `client`. The client can call `done(truthy_value)` to force\n * destruction of the client, but this should not be used except in\n * unusual circumstances.\n */\nexport const getClientAsync = defaultPool.getClientAsync.bind(defaultPool);\n\n/**\n * Performs a query with the given client.\n */\nexport const queryWithClientAsync = defaultPool.queryWithClientAsync.bind(defaultPool);\n\n/**\n * Performs a query with the given client. Errors if the query returns more\n * than one row.\n */\nexport const queryWithClientOneRowAsync = defaultPool.queryWithClientOneRowAsync.bind(defaultPool);\n\n/**\n * Performs a query with the given client. Errors if the query returns more\n * than one row.\n */\nexport const queryWithClientZeroOrOneRowAsync =\n defaultPool.queryWithClientZeroOrOneRowAsync.bind(defaultPool);\n/**\n * Rolls back the current transaction for the given client.\n */\nexport const rollbackWithClientAsync = defaultPool.rollbackWithClientAsync.bind(defaultPool);\nexport const beginTransactionAsync = defaultPool.beginTransactionAsync.bind(defaultPool);\n/**\n * Commits the transaction if err is null, otherwise rollbacks the transaction.\n * Also releases the client.\n */\nexport const endTransactionAsync = defaultPool.endTransactionAsync.bind(defaultPool);\n/**\n * Runs the specified function inside of a transaction. The function will\n * receive a database client as an argument, but it can also make queries\n * as usual, and the correct client will be used automatically.\n *\n * The transaction will be rolled back if the function throws an error, and\n * will be committed otherwise.\n */\nexport const runInTransactionAsync = defaultPool.runInTransactionAsync.bind(defaultPool);\n/**\n * Calls a sproc with the specified parameters using a specific client.\n */\nexport const callWithClientAsync = defaultPool.callWithClientAsync.bind(defaultPool);\n/**\n * Calls a sproc with the specified parameters using a specific client.\n * Errors if the sproc does not return exactly one row.\n */\nexport const callWithClientOneRowAsync = defaultPool.callWithClientOneRowAsync.bind(defaultPool);\n/**\n * Calls a sproc with the specified parameters using a specific client.\n * Errors if the sproc returns more than one row.\n */\nexport const callWithClientZeroOrOneRowAsync =\n defaultPool.callWithClientZeroOrOneRowAsync.bind(defaultPool);\n/**\n * Executes a query with the specified parameters. Returns an array of rows\n * that conform to the given Zod schema.\n */\nexport const queryRows = defaultPool.queryRows.bind(defaultPool);\n/**\n * Executes a query with the specified parameters. Returns exactly one row that conforms to the given Zod schema.\n */\nexport const queryRow = defaultPool.queryRow.bind(defaultPool);\n/**\n * Executes a query with the specified parameters. Returns either null or a\n * single row that conforms to the given Zod schema, and errors otherwise.\n */\nexport const queryOptionalRow = defaultPool.queryOptionalRow.bind(defaultPool);\n/**\n * Calls the given sproc with the specified parameters.\n * Errors if the sproc does not return anything.\n */\nexport const callRows = defaultPool.callRows.bind(defaultPool);\n/**\n * Calls the given sproc with the specified parameters.\n * Returns exactly one row from the sproc that conforms to the given Zod schema.\n */\nexport const callRow = defaultPool.callRow.bind(defaultPool);\n/**\n * Calls the given sproc with the specified parameters. Returns either null\n * or a single row that conforms to the given Zod schema.\n */\nexport const callOptionalRow = defaultPool.callOptionalRow.bind(defaultPool);\n/**\n * Executes a query and returns all values from a single column, validated\n * against the given Zod schema. Errors if the query returns more than one column.\n */\nexport const queryScalars = defaultPool.queryScalars.bind(defaultPool);\n/**\n * Executes a query and returns a single value from a single column, validated\n * against the given Zod schema. Errors if the query does not return exactly\n * one row or returns more than one column.\n */\nexport const queryScalar = defaultPool.queryScalar.bind(defaultPool);\n/**\n * Executes a query and returns a single value from a single column, or null\n * if no rows are returned. Validated against the given Zod schema. Errors if\n * the query returns more than one row or more than one column.\n */\nexport const queryOptionalScalar = defaultPool.queryOptionalScalar.bind(defaultPool);\n/**\n * Calls the given sproc and returns all values from a single column, validated\n * against the given Zod schema. Errors if the sproc returns more than one column.\n */\nexport const callScalars = defaultPool.callScalars.bind(defaultPool);\n/**\n * Calls the given sproc and returns a single value from a single column, validated\n * against the given Zod schema. Errors if the sproc does not return exactly\n * one row or returns more than one column.\n */\nexport const callScalar = defaultPool.callScalar.bind(defaultPool);\n/**\n * Calls the given sproc and returns a single value from a single column, or\n * null if no rows are returned. Validated against the given Zod schema.\n * Errors if the sproc returns more than one row or more than one column.\n */\nexport const callOptionalScalar = defaultPool.callOptionalScalar.bind(defaultPool);\n\n/**\n * Executes a query with the specified parameters. Returns the number of rows affected.\n */\nexport const execute = defaultPool.execute.bind(defaultPool);\n\n/**\n * Executes a query with the specified parameter, and errors if the query doesn't return exactly one row.\n */\nexport const executeRow = defaultPool.executeRow.bind(defaultPool);\n\n/**\n * Returns an {@link CursorIterator} that can be used to iterate over the\n * results of the query in batches, which is useful for large result sets.\n * Each row will be parsed by the given Zod schema.\n */\nexport const queryCursor = defaultPool.queryCursor.bind(defaultPool);\n/**\n * Set the schema to use for the search path.\n *\n * @param schema The schema name to use (can be \"null\" to unset the search path)\n */\nexport const setSearchSchema = defaultPool.setSearchSchema.bind(defaultPool);\n/**\n * Get the schema that is currently used for the search path.\n *\n * @returns schema in use (may be `null` to indicate no schema)\n */\nexport const getSearchSchema = defaultPool.getSearchSchema.bind(defaultPool);\n/**\n * Generate, set, and return a random schema name.\n *\n * @param prefix The prefix of the new schema, only the first 28 characters will be used (after lowercasing).\n * @returns The randomly-generated search schema.\n */\nexport const setRandomSearchSchemaAsync = defaultPool.setRandomSearchSchemaAsync.bind(defaultPool);\n\n/**\n * Deletes all schemas starting with the given prefix.\n *\n * @param prefix The prefix of the schemas to delete.\n */\nexport const clearSchemasStartingWith = defaultPool.clearSchemasStartingWith.bind(defaultPool);\n"]}
1
+ {"version":3,"file":"default-pool.d.ts","sourceRoot":"","sources":["../src/default-pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAEhF,QAAA,MAAM,WAAW,cAAqB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,CAAC;AAe9D;;GAEG;AACH,eAAO,MAAM,SAAS,gJAA0C,CAAC;AACjE;;GAEG;AACH,eAAO,MAAM,UAAU,qBAA2C,CAAC;AACnE;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,gDAA+C,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,oBAAoB,0HAAqD,CAAC;AAEvF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,0HAA2D,CAAC;AAEnG;;;GAGG;AACH,eAAO,MAAM,gCAAgC,kHACmB,CAAC;AACjE;;GAEG;AACH,eAAO,MAAM,uBAAuB,4DAAwD,CAAC;AAC7F,eAAO,MAAM,qBAAqB,gDAAsD,CAAC;AACzF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,2FAAoD,CAAC;AACrF;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,gFAAsD,CAAC;AACzF;;GAEG;AACH,eAAO,MAAM,mBAAmB,6HAAoD,CAAC;AACrF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,6HAA0D,CAAC;AACjG;;;GAGG;AACH,eAAO,MAAM,+BAA+B,6HACmB,CAAC;AAChE;;;GAGG;AACH,eAAO,MAAM,SAAS;;;CAA0C,CAAC;AACjE;;GAEG;AACH,eAAO,MAAM,QAAQ;;;CAAyC,CAAC;AAC/D;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;CAAiD,CAAC;AAC/E;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;CAAyC,CAAC;AAC/D;;;GAGG;AACH,eAAO,MAAM,OAAO;;;CAAwC,CAAC;AAC7D;;;GAGG;AACH,eAAO,MAAM,eAAe;;;CAAgD,CAAC;AAC7E;;;GAGG;AACH,eAAO,MAAM,YAAY;;;CAA6C,CAAC;AACvE;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;CAA4C,CAAC;AACrE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;CAAoD,CAAC;AACrF;;;GAGG;AACH,eAAO,MAAM,WAAW;;;CAA4C,CAAC;AACrE;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;CAA2C,CAAC;AACnE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;CAAmD,CAAC;AAEnF;;GAEG;AACH,eAAO,MAAM,OAAO,wDAAwC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,UAAU,sDAA2C,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;CAA4C,CAAC;AACrE;;;;GAIG;AACH,eAAO,MAAM,eAAe,0CAAgD,CAAC;AAC7E;;;;GAIG;AACH,eAAO,MAAM,eAAe,qBAAgD,CAAC;AAC7E;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,qCAA2D,CAAC;AAEnG;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,mCAAyD,CAAC","sourcesContent":["import { type CursorIterator, PostgresPool, type QueryParams } from './pool.js';\n\nconst defaultPool = new PostgresPool();\nexport { defaultPool, type CursorIterator, type QueryParams };\n\n// We re-expose all functions from the default pool here to account for the\n// default case of a shared global pool of clients. If someone want to create\n// their own pool, we expose the `PostgresPool` class.\n//\n// Note that we explicitly bind all functions to `defaultPool`. This ensures\n// that they'll be invoked with the correct `this` context, specifically when\n// this module is imported as `import * as db from '...'` and that import is\n// subsequently transformed by Babel to `interopRequireWildcard(...)`.\n\n// VSCode currently doesn't allow for us to use `inheritDoc` to inherit the\n// documentation from the `PostgresPool` class. We mirror the documentation\n// here for *async methods* in VSCode intellisense.\n\n/**\n * Creates a new connection pool and attempts to connect to the database.\n */\nexport const initAsync = defaultPool.initAsync.bind(defaultPool);\n/**\n * Closes the connection pool.\n */\nexport const closeAsync = defaultPool.closeAsync.bind(defaultPool);\n/**\n * Gets a new client from the connection pool. The caller MUST call `release()` to\n * release the client, whether or not errors occurred while using\n * `client`. The client can call `done(truthy_value)` to force\n * destruction of the client, but this should not be used except in\n * unusual circumstances.\n */\nexport const getClientAsync = defaultPool.getClientAsync.bind(defaultPool);\n\n/**\n * Performs a query with the given client.\n */\nexport const queryWithClientAsync = defaultPool.queryWithClientAsync.bind(defaultPool);\n\n/**\n * Performs a query with the given client. Errors if the query returns more\n * than one row.\n */\nexport const queryWithClientOneRowAsync = defaultPool.queryWithClientOneRowAsync.bind(defaultPool);\n\n/**\n * Performs a query with the given client. Errors if the query returns more\n * than one row.\n */\nexport const queryWithClientZeroOrOneRowAsync =\n defaultPool.queryWithClientZeroOrOneRowAsync.bind(defaultPool);\n/**\n * Rolls back the current transaction for the given client.\n */\nexport const rollbackWithClientAsync = defaultPool.rollbackWithClientAsync.bind(defaultPool);\nexport const beginTransactionAsync = defaultPool.beginTransactionAsync.bind(defaultPool);\n/**\n * Commits the transaction if err is null, otherwise rollbacks the transaction.\n * Also releases the client.\n */\nexport const endTransactionAsync = defaultPool.endTransactionAsync.bind(defaultPool);\n/**\n * Runs the specified function inside of a transaction. The function will\n * receive a database client as an argument, but it can also make queries\n * as usual, and the correct client will be used automatically.\n *\n * The transaction will be rolled back if the function throws an error, and\n * will be committed otherwise.\n */\nexport const runInTransactionAsync = defaultPool.runInTransactionAsync.bind(defaultPool);\n/**\n * Calls a sproc with the specified parameters using a specific client.\n */\nexport const callWithClientAsync = defaultPool.callWithClientAsync.bind(defaultPool);\n/**\n * Calls a sproc with the specified parameters using a specific client.\n * Errors if the sproc does not return exactly one row.\n */\nexport const callWithClientOneRowAsync = defaultPool.callWithClientOneRowAsync.bind(defaultPool);\n/**\n * Calls a sproc with the specified parameters using a specific client.\n * Errors if the sproc returns more than one row.\n */\nexport const callWithClientZeroOrOneRowAsync =\n defaultPool.callWithClientZeroOrOneRowAsync.bind(defaultPool);\n/**\n * Executes a query with the specified parameters. Returns an array of rows\n * that conform to the given Zod schema.\n */\nexport const queryRows = defaultPool.queryRows.bind(defaultPool);\n/**\n * Executes a query with the specified parameters. Returns exactly one row that conforms to the given Zod schema.\n */\nexport const queryRow = defaultPool.queryRow.bind(defaultPool);\n/**\n * Executes a query with the specified parameters. Returns either null or a\n * single row that conforms to the given Zod schema, and errors otherwise.\n */\nexport const queryOptionalRow = defaultPool.queryOptionalRow.bind(defaultPool);\n/**\n * Calls the given sproc with the specified parameters.\n * Errors if the sproc does not return anything.\n */\nexport const callRows = defaultPool.callRows.bind(defaultPool);\n/**\n * Calls the given sproc with the specified parameters.\n * Returns exactly one row from the sproc that conforms to the given Zod schema.\n */\nexport const callRow = defaultPool.callRow.bind(defaultPool);\n/**\n * Calls the given sproc with the specified parameters. Returns either null\n * or a single row that conforms to the given Zod schema.\n */\nexport const callOptionalRow = defaultPool.callOptionalRow.bind(defaultPool);\n/**\n * Executes a query and returns all values from a single column, validated\n * against the given Zod schema. Errors if the query returns more than one column.\n */\nexport const queryScalars = defaultPool.queryScalars.bind(defaultPool);\n/**\n * Executes a query and returns a single value from a single column, validated\n * against the given Zod schema. Errors if the query does not return exactly\n * one row or returns more than one column.\n */\nexport const queryScalar = defaultPool.queryScalar.bind(defaultPool);\n/**\n * Executes a query and returns a single value from a single column, or null\n * if no rows are returned. Validated against the given Zod schema. Errors if\n * the query returns more than one row or more than one column.\n */\nexport const queryOptionalScalar = defaultPool.queryOptionalScalar.bind(defaultPool);\n/**\n * Calls the given sproc and returns all values from a single column, validated\n * against the given Zod schema. Errors if the sproc returns more than one column.\n */\nexport const callScalars = defaultPool.callScalars.bind(defaultPool);\n/**\n * Calls the given sproc and returns a single value from a single column, validated\n * against the given Zod schema. Errors if the sproc does not return exactly\n * one row or returns more than one column.\n */\nexport const callScalar = defaultPool.callScalar.bind(defaultPool);\n/**\n * Calls the given sproc and returns a single value from a single column, or\n * null if no rows are returned. Validated against the given Zod schema.\n * Errors if the sproc returns more than one row or more than one column.\n */\nexport const callOptionalScalar = defaultPool.callOptionalScalar.bind(defaultPool);\n\n/**\n * Executes a query with the specified parameters. Returns the number of rows affected.\n */\nexport const execute = defaultPool.execute.bind(defaultPool);\n\n/**\n * Executes a query with the specified parameter, and errors if the query doesn't return exactly one row.\n */\nexport const executeRow = defaultPool.executeRow.bind(defaultPool);\n\n/**\n * Returns an {@link CursorIterator} that can be used to iterate over the\n * results of the query in batches, which is useful for large result sets.\n * Each row will be parsed by the given Zod schema.\n */\nexport const queryCursor = defaultPool.queryCursor.bind(defaultPool);\n/**\n * Set the schema to use for the search path.\n *\n * @param schema The schema name to use (can be \"null\" to unset the search path)\n */\nexport const setSearchSchema = defaultPool.setSearchSchema.bind(defaultPool);\n/**\n * Get the schema that is currently used for the search path.\n *\n * @returns schema in use (may be `null` to indicate no schema)\n */\nexport const getSearchSchema = defaultPool.getSearchSchema.bind(defaultPool);\n/**\n * Generate, set, and return a random schema name.\n *\n * @param prefix The prefix of the new schema, only the first 28 characters will be used (after lowercasing).\n * @returns The randomly-generated search schema.\n */\nexport const setRandomSearchSchemaAsync = defaultPool.setRandomSearchSchemaAsync.bind(defaultPool);\n\n/**\n * Deletes all schemas starting with the given prefix.\n *\n * @param prefix The prefix of the schemas to delete.\n */\nexport const clearSchemasStartingWith = defaultPool.clearSchemasStartingWith.bind(defaultPool);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prairielearn/postgres",
3
- "version": "6.0.1",
3
+ "version": "6.0.3",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,24 +17,25 @@
17
17
  "test": "vitest run --coverage"
18
18
  },
19
19
  "dependencies": {
20
- "@types/debug": "^4.1.12",
21
- "@types/pg-cursor": "^2.7.2",
22
- "es-toolkit": "^1.45.1",
20
+ "debug": "^4.4.3",
21
+ "es-toolkit": "^1.46.1",
23
22
  "multipipe": "^4.0.0",
24
23
  "pg": "^8.20.0",
25
24
  "pg-cursor": "^2.19.0",
26
25
  "pg-pool": "^3.13.0",
27
26
  "pg-protocol": "^1.13.0",
28
- "zod": "^3.25.76"
27
+ "zod": "^3.25.76 <4"
29
28
  },
30
29
  "devDependencies": {
31
- "@prairielearn/tsconfig": "^2.0.0",
30
+ "@prairielearn/tsconfig": "^2.1.0",
31
+ "@types/debug": "^4.1.13",
32
32
  "@types/multipipe": "^3.0.5",
33
- "@types/node": "^24.11.0",
34
- "@typescript/native-preview": "^7.0.0-dev.20260305.1",
35
- "@vitest/coverage-v8": "^4.0.18",
33
+ "@types/node": "^24.12.2",
34
+ "@types/pg": "^8.20.0",
35
+ "@types/pg-cursor": "^2.7.2",
36
+ "@typescript/native-preview": "beta",
37
+ "@vitest/coverage-v8": "^4.1.5",
36
38
  "tsx": "^4.21.0",
37
- "typescript": "^5.9.3",
38
- "vitest": "^4.0.18"
39
+ "vitest": "^4.1.5"
39
40
  }
40
41
  }
package/tsconfig.json CHANGED
@@ -1,8 +1,3 @@
1
1
  {
2
- "extends": "@prairielearn/tsconfig/tsconfig.package.json",
3
- "compilerOptions": {
4
- "outDir": "./dist",
5
- "rootDir": "./src",
6
- "types": ["node"]
7
- }
2
+ "extends": "@prairielearn/tsconfig/tsconfig.package-node.json"
8
3
  }