Skip to content

1.0 API discussion #364

Open
Open
@Soremwar

Description

@Soremwar

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions