Angaben zum Datum
Datum aus der Quelle.
Erstmals gesehen am .
Serverless von Neon
Neon Serverless 1.2.0: Flexiblere Verbindungsparameter, kein JSR mehr
In Neon Serverless 1.2.0 akzeptieren neon(...), transaction und query einzelne Verbindungsparameter (auch als sync oder async Funktionen), Client und Pool unterstützen bei aktiviertem pipelineConnect eine password-Funktion, parseIntoClientConfig wird exportiert, es gibt kleinere Fixes, und das Paket wird nicht mehr auf JSR veröffentlicht (stattdessen npm:@neondatabase/serverless verwenden).
Options to the
neon(...)HTTP-client creation function, and to thetransactionandqueryfunctions, now support individual connection parameters:user(orusername),password,host(orhostname),port,databaseandconnectionString.These can be strings (or number, for
port) or sync or async functions to be resolved on every query. They can supplement, override parts of, or fully replace the first-argument connection string.So this still works:
const sql = neon(DATABASE_URL)
But, for example, these now work too:
const sql = neon(DATABASE_URL_NO_PASSWORD, { password: () => getPasswordAsync() })const sql = neon({ user, password, host, database })const sql = neon({ connectionString: () => getConnectionString() })
ClientandPoolnow support a sync or async function as thepasswordconnection parameter whenpipelineConnectis enabled (this previously caused an error). AndparseIntoClientConfigfrompg-connection-stringis exported at top-level to make it easy to use apasswordfunction alongside a connection string:import { Pool, parseIntoClientConfig } from '@neondatabase/serverless'; const pool = new Pool({ ...parseIntoClientConfig(process.env.DATABASE_URL), password: () => getDatabaseAuthToken('argument'), });A few other minor fixes.
The package is no longer published to JSR. Please update any
jsrreferences tonpm:@neondatabase/serverless.