@fdy/simple-postgres
Advanced tools
Comparing version 7.0.0-alpha.4 to 7.0.0-alpha.5
@@ -5,2 +5,5 @@ import { PoolClient, QueryResult } from "pg"; | ||
import { TypedQueryStream } from "./TypedQueryStream"; | ||
interface QueryResultRow { | ||
[column: string]: unknown; | ||
} | ||
/** | ||
@@ -53,4 +56,4 @@ * An error so bad that we need to drop the database connection completely. | ||
*/ | ||
query<Row extends Record<string, unknown>>(query: SqlQueryObject): Promise<QueryResult<Row>>; | ||
query<Row extends Record<string, unknown>>(query: TemplateStringsArray, ...params: SqlLiteralParams[]): Promise<QueryResult<Row>>; | ||
query<Row extends QueryResultRow = any>(query: SqlQueryObject): Promise<QueryResult<Row>>; | ||
query<Row extends QueryResultRow = any>(query: TemplateStringsArray, ...params: SqlLiteralParams[]): Promise<QueryResult<Row>>; | ||
/** | ||
@@ -64,4 +67,4 @@ * Given a query that returns a single row, return a promise wrapping that | ||
*/ | ||
row<Row extends Record<string, unknown>>(query: SqlQueryObject): Promise<Row | undefined>; | ||
row<Row extends Record<string, unknown>>(query: TemplateStringsArray, ...params: SqlLiteralParams[]): Promise<Row | undefined>; | ||
row<Row extends QueryResultRow = any>(query: SqlQueryObject): Promise<Row | undefined>; | ||
row<Row extends QueryResultRow = any>(query: TemplateStringsArray, ...params: SqlLiteralParams[]): Promise<Row | undefined>; | ||
/** | ||
@@ -74,4 +77,4 @@ * Given a query that returns a collection of values, run the query and return | ||
*/ | ||
rows<Row extends Record<string, unknown>>(query: SqlQueryObject): Promise<Row[]>; | ||
rows<T extends Record<string, unknown>>(query: TemplateStringsArray, ...params: SqlLiteralParams[]): Promise<T[]>; | ||
rows<Row extends QueryResultRow = any>(query: SqlQueryObject): Promise<Row[]>; | ||
rows<Row extends QueryResultRow = any>(query: TemplateStringsArray, ...params: SqlLiteralParams[]): Promise<Row[]>; | ||
/** | ||
@@ -88,4 +91,4 @@ * Given a query that returns a collection of values, run the query and return | ||
*/ | ||
stream<Row extends Record<string, unknown>>(query: SqlQueryObject): Promise<TypedQueryStream<Row>>; | ||
stream<Row extends Record<string, unknown>>(query: TemplateStringsArray, ...params: SqlLiteralParams[]): Promise<TypedQueryStream<Row>>; | ||
stream<Row extends QueryResultRow = any>(query: SqlQueryObject): Promise<TypedQueryStream<Row>>; | ||
stream<Row extends QueryResultRow = any>(query: TemplateStringsArray, ...params: SqlLiteralParams[]): Promise<TypedQueryStream<Row>>; | ||
/** | ||
@@ -92,0 +95,0 @@ * Start a transaction on the current connection and then evaluate the block |
{ | ||
"name": "@fdy/simple-postgres", | ||
"version": "7.0.0-alpha.4", | ||
"version": "7.0.0-alpha.5", | ||
"description": "a minimal postgres interface for node", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
41821
827