postgrejs 2.15.0 → 2.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +88 -72
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# v2.15.1
|
|
2
|
+
[2024-07-22]
|
|
3
|
+
|
|
4
|
+
### Changes
|
|
5
|
+
|
|
6
|
+
* chore: Updated readme ([`f2db178`](https://github.com/panates/postgrejs/commit/f2db17882fb33729d2ef2044051c78affb7e6d2b))
|
|
7
|
+
* Changed package name to `postgrejs` ([`5ec4852`](https://github.com/panates/postgrejs/commit/5ec485244c9ac448e82b0649110315fc4d9b789e))
|
|
8
|
+
* Updated readme ([`72f6a1b`](https://github.com/panates/postgrejs/commit/72f6a1bc4bc0af17d9a7c7ce50be8ab5fcbfca2e))
|
|
9
|
+
* Implemented `sqlmode` query parameter for connection string and added `requireSSL` option to connection options. Now the driver tries SSL connection as a first choice. ([`3a27e85`](https://github.com/panates/postgrejs/commit/3a27e85dcbb7bd983dd2f835fa4ac785ad34e266))
|
|
10
|
+
* chore: Updated ([`a90a646`](https://github.com/panates/postgrejs/commit/a90a6461894883f12c396bc0a68518fb75d8bc17))
|
|
11
|
+
* chore: Updated readme ([`c581284`](https://github.com/panates/postgrejs/commit/c581284e2751e93674a26936f31ebbd8b753c2ca))
|
|
12
|
+
* chore: Updated readme ([`1f51284`](https://github.com/panates/postgrejs/commit/1f5128400a6ddff05552ad297cad930fe6244faf))
|
|
13
|
+
* chore: Updated readme ([`d439659`](https://github.com/panates/postgrejs/commit/d43965906101f3494270852b61203d1ce3339437))
|
|
14
|
+
* chore: Updated readme ([`2209d39`](https://github.com/panates/postgrejs/commit/2209d397ebd23d06061bfda10b49df830fb470e9))
|
|
15
|
+
* Updated readme ([`a00f471`](https://github.com/panates/postgrejs/commit/a00f471da79b569d36bbe76ce517a01adba17a24))
|
|
16
|
+
|
|
1
17
|
# v2.12.0
|
|
2
18
|
[2024-07-12]
|
|
3
19
|
|
package/README.md
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
<!--suppress HtmlDeprecatedAttribute -->
|
|
2
|
+
<p align="center">¨
|
|
3
|
+
<a href="https://postgrejs.panates.com/" target="blank">
|
|
4
|
+
<img src="https://postgrejs.panates.com/img/postgrejs-header-block.png" width="800" alt="PostgreJS Logo" />
|
|
5
|
+
</a>
|
|
6
|
+
</p>
|
|
2
7
|
|
|
3
8
|
[![NPM Version][npm-image]][npm-url]
|
|
4
9
|
[![NPM Downloads][downloads-image]][downloads-url]
|
|
@@ -6,31 +11,42 @@
|
|
|
6
11
|
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
7
12
|
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
PostgreJS is a enterprise-level PostgreSQL client for Node.js.
|
|
15
|
+
It is designed to provide a robust and efficient interface to PostgreSQL databases,
|
|
16
|
+
ensuring high performance and reliability for enterprise applications.
|
|
17
|
+
Written entirely in TypeScript, it leverages modern JavaScript features to deliver a seamless development experience.
|
|
10
18
|
|
|
11
19
|
|
|
12
|
-
## Library
|
|
20
|
+
## Library Overview
|
|
13
21
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
22
|
+
PostgreJS is a pure JavaScript library, meticulously crafted with TypeScript to offer a strictly typed, well-structured,
|
|
23
|
+
and highly maintainable codebase.
|
|
24
|
+
Key highlights include:
|
|
25
|
+
|
|
26
|
+
- **Language:** Pure modern JavaScript library.
|
|
27
|
+
- **Strictly Typed:** Completely written in TypeScript, offering strong typing and enhanced development experience.
|
|
28
|
+
- **Compatibility:** Works seamlessly with both CommonJS and ESM module systems, ensuring flexibility in various project setups.
|
|
29
|
+
- **Comprehensive Testing:** Rigorously tested to ensure stability and reliability in production environments.
|
|
30
|
+
- **Promise-Based API:** Asynchronous operations are handled with a Promise-based API, promoting clean and efficient asynchronous code.
|
|
19
31
|
|
|
20
32
|
## Features
|
|
21
33
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
- Named
|
|
25
|
-
- Cursors
|
|
26
|
-
- High
|
|
27
|
-
- Extensible data-types and type mapping
|
|
28
|
-
- Bind parameters with OID mappings
|
|
29
|
-
-
|
|
30
|
-
- Low memory utilization and boosted performance
|
|
31
|
-
-
|
|
32
|
-
- Can return both array and object rows
|
|
33
|
-
- Auto disposal with "using" syntax ([TC30 Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management))
|
|
34
|
+
- **Connection Management:** Supports both single connection and advanced pooling, providing scalability and efficient resource management.
|
|
35
|
+
- **Binary Wire Protocol:** Implements the full binary wire protocol for all PostgreSQL data types, ensuring robust and efficient data handling.
|
|
36
|
+
- **Prepared Statements:** Named prepared statements for optimized query execution.
|
|
37
|
+
- **Cursors:** Features fast double-link cache cursors for efficient data retrieval.
|
|
38
|
+
- **Notifications:** High-level implementation for PostgreSQL notifications (LISTEN/NOTIFY), enabling real-time data updates.
|
|
39
|
+
- **Extensibility:** Extensible data-types and type mapping to accommodate custom requirements.
|
|
40
|
+
- **Parameter Binding:** Bind parameters with OID mappings for precise and efficient query execution.
|
|
41
|
+
- **Array Handling:** Supports multidimensional arrays with fast binary encoding/decoding.
|
|
42
|
+
- **Performance Optimization:** Low memory utilization and boosted performance through the use of shared buffers.
|
|
43
|
+
- **Authorization:** SSupports various password algorithms including Clear text, MD5, and SASL, ensuring secure authentication.
|
|
44
|
+
- **Flexible Data Retrieval:** Can return both array and object rows to suit different data processing needs.
|
|
45
|
+
- **Resource Management:** Auto disposal of resources with the "using" syntax ([TC30 Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management)), ensuring efficient resource cleanup.
|
|
46
|
+
|
|
47
|
+
Whether you're building a simple application or a complex enterprise system,
|
|
48
|
+
PostgreJS provides the features and performance you need to succeed.
|
|
49
|
+
Explore the capabilities of the library and elevate your PostgreSQL integration to the next level.
|
|
34
50
|
|
|
35
51
|
|
|
36
52
|
## Installation
|
|
@@ -40,7 +56,7 @@ $ npm install postgrejs --save
|
|
|
40
56
|
```
|
|
41
57
|
|
|
42
58
|
## Documentation
|
|
43
|
-
Please read :small_orange_diamond: [DOCUMENTATION](
|
|
59
|
+
Please read :small_orange_diamond: [DOCUMENTATION](https://postgrejs.panates.com/) :small_orange_diamond: for detailed usage.
|
|
44
60
|
|
|
45
61
|
## Example usage
|
|
46
62
|
|
|
@@ -112,63 +128,63 @@ for (let i = 0; i < 100; i++) {
|
|
|
112
128
|
await statement.close(); // When you done, close the statement to relase resources
|
|
113
129
|
```
|
|
114
130
|
|
|
115
|
-
#### Check [DOCUMENTATION](
|
|
131
|
+
#### Check [DOCUMENTATION](https://postgrejs.panates.com/) for other examples.
|
|
116
132
|
|
|
117
133
|
|
|
118
134
|
|
|
119
135
|
## Type mappings
|
|
120
136
|
The table below lists builtin data type mappings.
|
|
121
137
|
|
|
122
|
-
|
|
|
123
|
-
|
|
124
|
-
| bool
|
|
125
|
-
| int2
|
|
126
|
-
| int4
|
|
127
|
-
| int8
|
|
128
|
-
| float4
|
|
129
|
-
| float8
|
|
130
|
-
| char
|
|
131
|
-
| bpchar
|
|
132
|
-
| varchar
|
|
133
|
-
| date
|
|
134
|
-
| time
|
|
135
|
-
| timestamp
|
|
136
|
-
| timestamptz
|
|
137
|
-
| oid
|
|
138
|
-
| bytea
|
|
139
|
-
| uuid
|
|
140
|
-
| json
|
|
141
|
-
| jsonb
|
|
142
|
-
| xml
|
|
143
|
-
| point
|
|
144
|
-
| circle
|
|
145
|
-
| lseg
|
|
146
|
-
| box
|
|
147
|
-
| int2Vector
|
|
148
|
-
| _bool
|
|
149
|
-
| _int2
|
|
150
|
-
| _int4
|
|
151
|
-
| _int8
|
|
152
|
-
| _float4
|
|
153
|
-
| _float8
|
|
154
|
-
| _char
|
|
155
|
-
| _bpchar
|
|
156
|
-
| _varchar
|
|
157
|
-
| _date
|
|
158
|
-
| _time
|
|
159
|
-
| _timestamp
|
|
160
|
-
| _timestamptz
|
|
161
|
-
| _uuid
|
|
162
|
-
| _oid
|
|
163
|
-
| _bytea
|
|
164
|
-
| _json
|
|
165
|
-
| _jsonb
|
|
166
|
-
| _xml
|
|
167
|
-
| _point
|
|
168
|
-
| _circle
|
|
169
|
-
| _lseg
|
|
170
|
-
| _box
|
|
171
|
-
| _int2Vector
|
|
138
|
+
| PosgtreSQL type | JS type | Receive | Send |
|
|
139
|
+
|-----------------|:------------|-------------|--------|
|
|
140
|
+
| bool | boolean | text,binary | binary |
|
|
141
|
+
| int2 | number | text,binary | binary |
|
|
142
|
+
| int4 | number | text,binary | binary |
|
|
143
|
+
| int8 | BigInt | text,binary | binary |
|
|
144
|
+
| float4 | number | text,binary | binary |
|
|
145
|
+
| float8 | number | text,binary | binary |
|
|
146
|
+
| char | string | text,binary | binary |
|
|
147
|
+
| bpchar | string | text,binary | binary |
|
|
148
|
+
| varchar | string | text,binary | binary |
|
|
149
|
+
| date | Date | text,binary | binary |
|
|
150
|
+
| time | Date | text,binary | binary |
|
|
151
|
+
| timestamp | Date | text,binary | binary |
|
|
152
|
+
| timestamptz | Date | text,binary | binary |
|
|
153
|
+
| oid | number | text,binary | binary |
|
|
154
|
+
| bytea | Buffer | text,binary | binary |
|
|
155
|
+
| uuid | string | text,binary | binary |
|
|
156
|
+
| json | object | text,binary | binary |
|
|
157
|
+
| jsonb | object | text,binary | binary |
|
|
158
|
+
| xml | string | text,binary | binary |
|
|
159
|
+
| point | Point | text,binary | binary |
|
|
160
|
+
| circle | Circle | text,binary | binary |
|
|
161
|
+
| lseg | Rectangle | text,binary | binary |
|
|
162
|
+
| box | Rectangle | text,binary | binary |
|
|
163
|
+
| int2Vector | number[] | text,binary | binary |
|
|
164
|
+
| _bool | boolean[] | text,binary | binary |
|
|
165
|
+
| _int2 | number[] | text,binary | binary |
|
|
166
|
+
| _int4 | number[] | text,binary | binary |
|
|
167
|
+
| _int8 | BigInt[] | text,binary | binary |
|
|
168
|
+
| _float4 | number[] | text,binary | binary |
|
|
169
|
+
| _float8 | number[] | text,binary | binary |
|
|
170
|
+
| _char | string[] | text,binary | binary |
|
|
171
|
+
| _bpchar | string[] | text,binary | binary |
|
|
172
|
+
| _varchar | string[] | text,binary | binary |
|
|
173
|
+
| _date | Date[] | text,binary | binary |
|
|
174
|
+
| _time | Date[] | text,binary | binary |
|
|
175
|
+
| _timestamp | Date[] | text,binary | binary |
|
|
176
|
+
| _timestamptz | Date[] | text,binary | binary |
|
|
177
|
+
| _uuid | string[] | text,binary | binary |
|
|
178
|
+
| _oid | number[] | text,binary | binary |
|
|
179
|
+
| _bytea | Buffer[] | text,binary | binary |
|
|
180
|
+
| _json | object[] | text,binary | binary |
|
|
181
|
+
| _jsonb | object[] | text,binary | binary |
|
|
182
|
+
| _xml | string[] | text,binary | binary |
|
|
183
|
+
| _point | Point[] | text,binary | binary |
|
|
184
|
+
| _circle | Circle[] | text,binary | binary |
|
|
185
|
+
| _lseg | Rectangle[] | text,binary | binary |
|
|
186
|
+
| _box | Rectangle[] | text,binary | binary |
|
|
187
|
+
| _int2Vector | number[][] | text,binary | binary |
|
|
172
188
|
|
|
173
189
|
|
|
174
190
|
## Support
|