Zum Inhalt springen

Serverless Updates & Release Notes

1 Eintrag aus 1 Quelle. Zuletzt aktualisiert:

Folge Serverless, um die Release Notes in deinen Feed zu holen.

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 the transaction and query functions, now support individual connection parameters: user (or username), password, host (or hostname), port, database and connectionString.

    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() })
  • Client and Pool now support a sync or async function as the password connection parameter when pipelineConnect is enabled (this previously caused an error). And parseIntoClientConfig from pg-connection-string is exported at top-level to make it easy to use a password function 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 jsr references to npm:@neondatabase/serverless.

Originalquelle(öffnet in neuem Tab)Problem melden