@vercel/postgres
Advanced tools
Comparing version 0.1.0-canary.28 to 0.1.0-canary.29
@@ -1,2 +0,2 @@ | ||
export { VercelClient, VercelPool, VercelPostgresClientConfig, VercelPostgresPoolConfig, createClient, createPool, db, postgresConnectionString, sql } from './index.js'; | ||
export { VercelClient, VercelClientBase, VercelPool, VercelPoolClient, VercelPostgresClientConfig, VercelPostgresPoolConfig, createClient, createPool, db, postgresConnectionString, sql } from './index.js'; | ||
export { Client, FieldDef, Pool, Query, QueryArrayConfig, QueryArrayResult, QueryConfig, QueryParse, QueryResult, QueryResultBase, QueryResultRow } from '@neondatabase/serverless'; |
@@ -1,1 +0,1 @@ | ||
import{a as t,b as f,c as m,d as e,e as i,f as n,g as p}from"./chunk-IHU7QAEO.js";import{neonConfig as o}from"@neondatabase/serverless";import r from"ws";o&&(o.webSocketConstructor=r);export{e as VercelClient,f as VercelPool,i as createClient,m as createPool,p as db,t as postgresConnectionString,n as sql}; | ||
import{a as t,b as f,c as m,d as e,e as i,f as n,g as p}from"./chunk-MIUFAVOQ.js";import{neonConfig as o}from"@neondatabase/serverless";import r from"ws";o&&(o.webSocketConstructor=r);export{f as VercelClient,e as VercelPool,m as createClient,i as createPool,p as db,t as postgresConnectionString,n as sql}; |
@@ -1,11 +0,17 @@ | ||
import { ClientConfig, PoolConfig, Pool, QueryResultRow, QueryResult, Client } from '@neondatabase/serverless'; | ||
import { ClientConfig, PoolConfig, ClientBase, QueryResultRow, QueryResult, Client, Pool } from '@neondatabase/serverless'; | ||
export { Client, FieldDef, Pool, Query, QueryArrayConfig, QueryArrayResult, QueryConfig, QueryParse, QueryResult, QueryResultBase, QueryResultRow } from '@neondatabase/serverless'; | ||
declare type Primitive = string | number | boolean | undefined | null; | ||
declare type ConfigItemsToOmit = 'user' | 'database' | 'password' | 'host' | 'port'; | ||
declare type VercelPostgresClientConfig = Omit<ClientConfig, ConfigItemsToOmit>; | ||
declare type VercelPostgresPoolConfig = Omit<PoolConfig, ConfigItemsToOmit>; | ||
interface VercelClientBase extends ClientBase { | ||
sql: <O extends QueryResultRow>(strings: TemplateStringsArray, ...values: Primitive[]) => Promise<QueryResult<O>>; | ||
} | ||
interface VercelPoolClient extends VercelClientBase { | ||
release: (err?: Error | boolean) => void; | ||
} | ||
declare type Primitive = string | number | boolean | undefined | null; | ||
declare class VercelPool extends Pool { | ||
declare class VercelClient extends Client { | ||
/** | ||
@@ -17,6 +23,8 @@ * A template literal tag providing safe, easy to use SQL parameterization. | ||
* ```ts | ||
* const pool = createPool(); | ||
* const pool = createClient(); | ||
* const userId = 123; | ||
* await client.connect(); | ||
* const result = await pool.sql`SELECT * FROM users WHERE id = ${userId}`; | ||
* // Equivalent to: await pool.query('SELECT * FROM users WHERE id = $1', [id]); | ||
* await client.end(); | ||
* ``` | ||
@@ -27,5 +35,6 @@ * @returns A promise that resolves to the query result. | ||
} | ||
declare function createPool(config?: VercelPostgresPoolConfig): VercelPool; | ||
declare function createClient(config?: VercelPostgresClientConfig): VercelClient; | ||
declare class VercelClient extends Client { | ||
declare class VercelPool extends Pool { | ||
Client: typeof VercelClient; | ||
/** | ||
@@ -37,8 +46,6 @@ * A template literal tag providing safe, easy to use SQL parameterization. | ||
* ```ts | ||
* const pool = createClient(); | ||
* const pool = createPool(); | ||
* const userId = 123; | ||
* await client.connect(); | ||
* const result = await pool.sql`SELECT * FROM users WHERE id = ${userId}`; | ||
* // Equivalent to: await pool.query('SELECT * FROM users WHERE id = $1', [id]); | ||
* await client.end(); | ||
* ``` | ||
@@ -48,4 +55,6 @@ * @returns A promise that resolves to the query result. | ||
sql<O extends QueryResultRow>(strings: TemplateStringsArray, ...values: Primitive[]): Promise<QueryResult<O>>; | ||
connect(): Promise<VercelPoolClient>; | ||
connect(callback: (err: Error, client: VercelPoolClient, done: (release?: any) => void) => void): void; | ||
} | ||
declare function createClient(config?: VercelPostgresClientConfig): VercelClient; | ||
declare function createPool(config?: VercelPostgresPoolConfig): VercelPool; | ||
@@ -59,2 +68,2 @@ declare function sql<O extends QueryResultRow>(strings: TemplateStringsArray, ...values: Primitive[]): Promise<QueryResult<O>>; | ||
export { VercelClient, VercelPool, VercelPostgresClientConfig, VercelPostgresPoolConfig, createClient, createPool, db, postgresConnectionString, sql }; | ||
export { VercelClient, VercelClientBase, VercelPool, VercelPoolClient, VercelPostgresClientConfig, VercelPostgresPoolConfig, createClient, createPool, db, postgresConnectionString, sql }; |
@@ -1,1 +0,1 @@ | ||
import{a,b,c,d,e,f,g}from"./chunk-IHU7QAEO.js";export{d as VercelClient,b as VercelPool,e as createClient,c as createPool,g as db,a as postgresConnectionString,f as sql}; | ||
import{a,b,c,d,e,f,g}from"./chunk-MIUFAVOQ.js";export{b as VercelClient,d as VercelPool,c as createClient,e as createPool,g as db,a as postgresConnectionString,f as sql}; |
{ | ||
"name": "@vercel/postgres", | ||
"version": "0.1.0-canary.28", | ||
"version": "0.1.0-canary.29", | ||
"description": "Connect to Vercel Postgres databases on the Edge", | ||
@@ -5,0 +5,0 @@ "homepage": "https://vercel.com", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
15456
85