Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0 API discussion #364

Open
2 of 20 tasks
Soremwar opened this issue Jan 7, 2022 · 2 comments
Open
2 of 20 tasks

1.0 API discussion #364

Soremwar opened this issue Jan 7, 2022 · 2 comments

Comments

@Soremwar
Copy link
Collaborator

Soremwar commented Jan 7, 2022

API v1.0

Client derivates

  • applicationName -> application_name
  • hostname -> host (Add JSDoc indicating this can be a path to a Unix socket as well)
  • tls.caCertificates -> ca_certificates
  • tls.enable and tls.enforce must be merged into a single option

Pooling

  • Pool can be initialized without arguments, just like Client
  • Pool options should be passed as an object, instead of additional arguments
  • Pool size should have a default
  • connect -> getClient

queryArray / queryObject

  • Remove query*(sql, ...params) overload. Parameters must be provided as an object or as an array instead of relying on rest syntax
  • QueryConfig.args -> arguments
  • QueryConfig.text -> query
  • Remove QueryConfig.encoder

QueryResult

  • rowCount -> affectedRows
  • affectedRows is always set
  • command must be a union type, not string
  • text -> query

Edited for brevity and clarity

@iugo
Copy link
Contributor

iugo commented Mar 19, 2022

  • rowCount -> affectedRows +1
  • affectedRows is always set +1

@KyleJune
Copy link

KyleJune commented May 20, 2022

More pool options like the node pg package has would be nice. You might be able to re-use code from pg-pool. The pg package uses the pg-pool package for managing it's pools and has options related to timing out connections and recreating them if they have been connected for a long time.

https://www.npmjs.com/package/pg-pool

@denodrivers denodrivers deleted a comment from Soremwar Feb 5, 2024
@denodrivers denodrivers deleted a comment from Soremwar Feb 5, 2024
@denodrivers denodrivers deleted a comment from Soremwar Feb 5, 2024
@denodrivers denodrivers deleted a comment from Soremwar Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants