Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@vercel/postgres
Advanced tools
A client that works with Vercel Postgres.
npm install @vercel/postgres
Default Export
import postgres from '@vercel/postgres';
await postgres.query('SELECT * from POSTS WHERE likes > 100;');
Named Export
import { postgres } from '@vercel/postgres';
await postgres.query('SELECT * from POSTS WHERE likes > 100;');
import { createClient } from '@vercel/postgres';
const postgres = createClient(process.env.SOME_POSTGRES_CONNECTION_STRING);
await postgres.query('SELECT * from POSTS WHERE likes > 100;');
import { postgres } from '@vercel/postgres';
await postgres.query('SELECT * from POSTS WHERE author=$1;', ['rauchg']);
When using the createClient
function, you can pass an optional configuration object that conforms to PostgresConfig
:
export interface PostgresConfig {
connectionString?: string | undefined;
keepAlive?: boolean | undefined;
statement_timeout?: false | number | undefined;
query_timeout?: number | undefined;
keepAliveInitialDelayMillis?: number | undefined;
idle_in_transaction_session_timeout?: number | undefined;
application_name?: string | undefined;
connectionTimeoutMillis?: number | undefined;
max?: number | undefined;
min?: number | undefined;
idleTimeoutMillis?: number | undefined;
log?: ((...messages: unknown[]) => void) | undefined;
allowExitOnIdle?: boolean | undefined;
maxUses?: number | undefined;
}
The @vercel/postgres
package uses the pg
under the hood. For
more detailed documentation, checkout node-postgres.
FAQs
Connect to Vercel Postgres databases on the Edge
The npm package @vercel/postgres receives a total of 55,467 weekly downloads. As such, @vercel/postgres popularity was classified as popular.
We found that @vercel/postgres demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.