Skip to content

http connection parameters - #227

Merged
jawj merged 26 commits into
mainfrom
http-connection-parameters
Sep 30, 2026
Merged

jawj merged 26 commits into
mainfrom
http-connection-parameters

Conversation

@jawj

@jawj jawj commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Changes which (amongst other benefits) support OIDC auth for Neon partners:

  • 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).

  • parseIntoClientConfig is exported, to support supplementing a connection string with a function to retrieve a token as password (recent changes exported parseConnectionString instead, but this turns out to be more suitable).

Smaller changes:

  • HTTP-related code has been refactored into its own folder, with NeonDbError and NeonQueryPromise getting their own files.

  • application_name is now used to report the driver identity and version to the proxy, unless overridden.

  • Minor fixes to TLS handling, addressing two PRs.

  • A few minor dependency updates.

jawj and others added 22 commits April 17, 2026 12:59
…te all dependencies and make necessary changes
…nction passwords for Client and Pool with pipelineConnect
@jawj
jawj marked this pull request as ready for review September 25, 2026 10:41
@jawj
jawj requested a review from pffigueiredo September 25, 2026 10:41

@pffigueiredo pffigueiredo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also add docs about these:

  • parseIntoClientConfig
  • Function passwords for Client/Pool

Comment thread src/client.ts Outdated
Comment thread index.d.mts Outdated
Comment thread CHANGELOG.md Outdated
Comment thread index.d.mts
@jawj
jawj merged commit fa911c3 into main Sep 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants