2
2
3
3
![ Build Status] ( https://img.shields.io/github/actions/workflow/status/denodrivers/postgres/ci.yml?branch=main&label=Build&logo=github&style=flat-square )
4
4
[ ![ Discord server] ( https://img.shields.io/discord/768918486575480863?color=blue&label=Ask%20for%20help%20here&logo=discord&style=flat-square )] ( https://discord.gg/HEdTCvZUSf )
5
+ [ ![ JSR] ( https://jsr.io/badges/@db/postgres?style=flat-square )] ( https://jsr.io/@db/postgres )
6
+ [ ![ JSR Score] ( https://jsr.io/badges/@db/postgres/score?style=flat-square )] ( https://jsr.io/@db/postgres )
5
7
[ ![ Manual] ( https://img.shields.io/github/v/release/denodrivers/postgres?color=orange&label=Manual&logo=deno&style=flat-square )] ( https://deno-postgres.com )
6
- [ ![ Documentation] ( https://img.shields.io/github/v/release/denodrivers/postgres?color=yellow&label=Documentation&logo=deno&style=flat-square )] ( https://doc.deno.land/https/deno.land/x/ postgres/mod.ts )
8
+ [ ![ Documentation] ( https://img.shields.io/github/v/release/denodrivers/postgres?color=yellow&label=Documentation&logo=deno&style=flat-square )] ( https://jsr.io/@db/ postgres/doc )
7
9
[ ![ License] ( https://img.shields.io/github/license/denodrivers/postgres?color=yellowgreen&label=License&style=flat-square )] ( LICENSE )
8
10
9
11
A lightweight PostgreSQL driver for Deno focused on developer experience.
10
12
11
- ` deno-postgres ` is being developed inspired by the excellent work of
13
+ ` deno-postgres ` is inspired by the excellent work of
12
14
[ node-postgres] ( https://github.com/brianc/node-postgres ) and
13
15
[ pq] ( https://github.com/lib/pq ) .
14
16
15
17
## Documentation
16
18
17
- The documentation is available on the ` deno-postgres ` website
18
- [ https:// deno-postgres.com/ ] ( https://deno-postgres.com/ )
19
+ The documentation is available on the
20
+ [ ` deno-postgres ` website ] ( https://deno-postgres.com/ ) .
19
21
20
22
Join the [ Discord] ( https://discord.gg/HEdTCvZUSf ) as well! It's a good place to
21
23
discuss bugs and features before opening issues.
@@ -24,14 +26,15 @@ discuss bugs and features before opening issues.
24
26
25
27
``` ts
26
28
// deno run --allow-net --allow-read mod.ts
27
- import { Client } from " https://deno.land/x/ postgres/mod.ts " ;
29
+ import { Client } from " jsr:@db/ postgres" ;
28
30
29
31
const client = new Client ({
30
32
user: " user" ,
31
33
database: " test" ,
32
34
hostname: " localhost" ,
33
35
port: 5432 ,
34
36
});
37
+
35
38
await client .connect ();
36
39
37
40
{
@@ -59,6 +62,40 @@ await client.connect();
59
62
await client .end ();
60
63
```
61
64
65
+ ## Deno compatibility
66
+
67
+ Due to breaking changes introduced in the unstable APIs ` deno-postgres ` uses,
68
+ there has been some fragmentation regarding what versions of Deno can be used
69
+ alongside the driver.
70
+
71
+ This situation will stabilize as ` deno-postgres ` approach version 1.0.
72
+
73
+ | Deno version | Min driver version | Max version | Note |
74
+ | ------------- | ------------------ | ------------------- | ------------------------------------------------------------------------------ |
75
+ | 1.8.x | 0.5.0 | 0.10.0 | |
76
+ | 1.9.0 | 0.11.0 | 0.11.1 | |
77
+ | 1.9.1 and up | 0.11.2 | 0.11.3 | |
78
+ | 1.11.0 and up | 0.12.0 | 0.12.0 | |
79
+ | 1.14.0 and up | 0.13.0 | 0.13.0 | |
80
+ | 1.16.0 | 0.14.0 | 0.14.3 | |
81
+ | 1.17.0 | 0.15.0 | 0.17.1 | |
82
+ | 1.40.0 | 0.17.2 | currently supported | 0.17.2 [ on JSR] ( https://jsr.io/@bartlomieju/postgres ) |
83
+ | 2.0.0 and up | 0.19.4 | currently supported | All versions available as [ ` @db/postgres ` on JSR] ( https://jsr.io/@db/postgres ) |
84
+
85
+ ## Breaking changes
86
+
87
+ Although ` deno-postgres ` is reasonably stable and robust, it is a WIP, and we're
88
+ still exploring the design. Expect some breaking changes as we reach version 1.0
89
+ and enhance the feature set. Please check the Releases for more info on breaking
90
+ changes. Please reach out if there are any undocumented breaking changes.
91
+
92
+ ## Found issues?
93
+
94
+ Please
95
+ [ file an issue] ( https://github.com/denodrivers/postgres/issues/new/choose ) with
96
+ any problems with the driver. If you would like to help, please look at the
97
+ issues as well. You can pick up one of them and try to implement it.
98
+
62
99
## Contributing
63
100
64
101
### Prerequisites
@@ -73,8 +110,8 @@ await client.end();
73
110
it to run the linter and formatter locally
74
111
75
112
- https://deno.land/
76
- - ` deno upgrade --version 1.40.0 `
77
- - ` dvm install 1.40.0 && dvm use 1.40.0 `
113
+ - ` deno upgrade stable `
114
+ - ` dvm install stable && dvm use stable `
78
115
79
116
- You don't need to install Postgres locally on your machine to test the
80
117
library; it will run as a service in the Docker container when you build it
@@ -96,8 +133,8 @@ It is recommended that you don't rely on any previously initialized data for
96
133
your tests instead create all the data you need at the moment of running the
97
134
tests
98
135
99
- For example, the following test will create a temporal table that will disappear
100
- once the test has been completed
136
+ For example, the following test will create a temporary table that will
137
+ disappear once the test has been completed
101
138
102
139
``` ts
103
140
Deno .test (" INSERT works correctly" , async () => {
@@ -134,41 +171,6 @@ a local testing environment, as shown in the following steps:
134
171
3 . Run the tests manually by using the command\
135
172
` deno test -A `
136
173
137
- ## Deno compatibility
138
-
139
- Due to breaking changes introduced in the unstable APIs ` deno-postgres ` uses,
140
- there has been some fragmentation regarding what versions of Deno can be used
141
- alongside the driver.
142
-
143
- This situation will stabilize as ` std ` and ` deno-postgres ` approach version 1.0.
144
-
145
- | Deno version | Min driver version | Max driver version | Note |
146
- | ------------- | ------------------ | ------------------ | -------------------- |
147
- | 1.8.x | 0.5.0 | 0.10.0 | |
148
- | 1.9.0 | 0.11.0 | 0.11.1 | |
149
- | 1.9.1 and up | 0.11.2 | 0.11.3 | |
150
- | 1.11.0 and up | 0.12.0 | 0.12.0 | |
151
- | 1.14.0 and up | 0.13.0 | 0.13.0 | |
152
- | 1.16.0 | 0.14.0 | 0.14.3 | |
153
- | 1.17.0 | 0.15.0 | 0.17.1 | |
154
- | 1.40.0 | 0.17.2 | | Now available on JSR |
155
-
156
- ## Breaking changes
157
-
158
- Although ` deno-postgres ` is reasonably stable and robust, it is a WIP, and we're
159
- still exploring the design. Expect some breaking changes as we reach version 1.0
160
- and enhance the feature set. Please check the Releases for more info on breaking
161
- changes. Please reach out if there are any undocumented breaking changes.
162
-
163
- ## Found issues?
164
-
165
- Please
166
- [ file an issue] ( https://github.com/denodrivers/postgres/issues/new/choose ) with
167
- any problems with the driver in this repository's issue section. If you would
168
- like to help, please look at the
169
- [ issues] ( https://github.com/denodrivers/postgres/issues ) as well. You can pick
170
- up one of them and try to implement it.
171
-
172
174
## Contributing guidelines
173
175
174
176
When contributing to the repository, make sure to:
@@ -194,5 +196,5 @@ preserved their individual licenses and copyrights.
194
196
195
197
Everything is licensed under the MIT License.
196
198
197
- All additional work is copyright 2018 - 2024 — Bartłomiej Iwańczuk, Steven
199
+ All additional work is copyright 2018 - 2025 — Bartłomiej Iwańczuk, Steven
198
200
Guerrero, Hector Ayala — All rights reserved.
0 commit comments