{"repo":"exedealer/pgwire","free":true,"listed":false,"github":"https://github.com/exedealer/pgwire","clone":"git clone https://github.com/exedealer/pgwire.git","description":"PostgreSQL client library for Deno and Node.js that exposes all features of the wire protocol.","language":"JavaScript","stars":83,"topics":["postgres","postgresql","postgresql-driver","libpq","logical-replication","streaming-replication","logical-decoding","pgoutput"],"license":"MIT","category":"databases-storage","readme_excerpt":"pgwire PostgreSQL client library for Deno and Node.js that exposes all features of wire protocol. - Memory efficient data streaming - Logical replication, including pgoutput protocol - Copy from stdin and to stdout - Query cancellation - Implicit-transaction multi-statement queries - Listen/Notify - Query pipelining, single round trip - Efficient bytea transferring - OOM protected - Pure js without dependencies Create connection https://www.postgresql.org/docs/18/libpq-connect.html#LIBPQ-CONNSTRING-URIS Good practice is to get connection URI from environment variable: Set POSTGRES environment variable when run process: pgconnection() function also accepts parameters as object: Its possible to pass multiple connection URIs or objects to pgconnection() function. In this case actual connection parameters will be computed by merging all parameters in first-win priority. Following technique can be used to force specific parameters values or provide default-fallback values: Don't forget to .end() connection when you don't need it anymore: Using pgwire in web server When poolSize is not set then a new connection is created for each query. This option makes possible to switch to external connection pool like pgBouncer. Querying Function call and other single-value results can be accessed by array destructuring. Parametrized query TODO Why no interpolation API Multi-statement queries Postgres allows to execute multiple statements within a single query. Postgres wraps multi-statement q","default_branch":null,"files":null,"tree":[],"storefront":"/r/exedealer","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/exedealer/pgwire/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}