File tree 10 files changed +287
-20
lines changed
10 files changed +287
-20
lines changed Original file line number Diff line number Diff line change 11
11
env :
12
12
PGDATADIR : /var/lib/postgresql/data
13
13
14
+ permissions :
15
+ contents : read
16
+ pages : write
17
+ id-token : write
18
+
14
19
jobs :
15
20
build :
16
21
runs-on : ubuntu-latest
73
78
PGPORT : ${{ job.services.postgres.ports[5432] }}
74
79
PGUSER : postgres
75
80
PGPASSWORD : postgres
81
+ - name : Docs
82
+ run : npx typedoc
83
+ - uses : actions/upload-pages-artifact@v2
84
+ with :
85
+ path : ./docs
86
+ deploy :
87
+ runs-on : ubuntu-latest
88
+ environment :
89
+ name : github-pages
90
+ url : ${{ steps.deployment.outputs.page_url }}
91
+ needs : build
92
+ steps :
93
+ - name : Deploy to GitHub Pages
94
+ id : deployment
95
+ uses : actions/deploy-pages@v2
Original file line number Diff line number Diff line change 1
- # ts-postgres
2
-
3
1
![ Build Status] ( https://github.com/malthe/ts-postgres/actions/workflows/main.yml/badge.svg )
4
2
<span class =" badge-npmversion " ><a href =" https://npmjs.org/package/ts-postgres " title =" View this project on NPM " ><img src =" https://img.shields.io/npm/v/ts-postgres.svg " alt =" NPM version " /></a ></span >
5
3
<span class =" badge-npmdownloads " ><a href =" https://npmjs.org/package/ts-postgres " title =" View this project on NPM " ><img src =" https://img.shields.io/npm/dm/ts-postgres.svg " alt =" NPM downloads " /></a ></span >
@@ -26,6 +24,8 @@ $ npm install ts-postgres@latest
26
24
* Promise-based
27
25
* Streaming
28
26
27
+ See the [ documentation] ( https://malthe.github.io/ts-postgres/ ) for a complete reference.
28
+
29
29
---
30
30
31
31
## Usage
@@ -59,7 +59,7 @@ async function main() {
59
59
}
60
60
}
61
61
62
- await main ()
62
+ await main ();
63
63
```
64
64
Waiting on the result (i.e., result iterator) returns the complete query result.
65
65
Original file line number Diff line number Diff line change 74
74
"eslint-config-standard" : " ^17.1.0" ,
75
75
"eslint-plugin-import" : " ^2.29.0" ,
76
76
"eslint-plugin-node" : " ^11.1.0" ,
77
- "eslint-plugin-promise" : " ^6.1.1" ,
78
77
"eslint-plugin-prettier" : " ^5.0.1" ,
78
+ "eslint-plugin-promise" : " ^6.1.1" ,
79
79
"jest" : " ^29.7.0" ,
80
80
"lint-staged" : " ^15.0.2" ,
81
81
"rimraf" : " ^3.0.2" ,
82
82
"ts-jest" : " ^29.1.1" ,
83
83
"ts-node" : " ^10.9.1" ,
84
+ "typedoc" : " ^0.25.4" ,
84
85
"typescript" : " ^4.9.5"
85
86
}
86
87
}
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ export interface PreparedStatement<T = ResultRecord> {
101
101
) => ResultIterator < T >
102
102
}
103
103
104
- type Callback < T > = ( data : T ) => void ;
104
+ export type Callback < T > = ( data : T ) => void ;
105
105
106
106
/* eslint-disable @typescript-eslint/no-explicit-any */
107
107
type CallbackOf < U > = U extends any ? Callback < U > : never ;
@@ -155,6 +155,11 @@ interface PreFlightQueue {
155
155
bind : Bind | null ;
156
156
}
157
157
158
+ /** A database client, opening a single connection to the database.
159
+ *
160
+ * @remarks
161
+ * You must open the connection using {@link connect}, otherwise no query will be processed.
162
+ */
158
163
export class Client {
159
164
private readonly events = {
160
165
connect : new TypedEvent < Connect > ( ) ,
@@ -197,6 +202,11 @@ export class Client {
197
202
public secretKey : number | null = null ;
198
203
public transactionStatus : TransactionStatus | null = null ;
199
204
205
+ /**
206
+ * @param config - An optional configuration object, comprised of connection details
207
+ * and client configuration. Most of the connection details can also be specified
208
+ * using environment variables, see {@link Environment}.
209
+ */
200
210
constructor ( public readonly config : Configuration = { } ) {
201
211
this . encoding = config . clientEncoding || defaults . clientEncoding as BufferEncoding || 'utf-8' ;
202
212
this . writer = new Writer ( this . encoding ) ;
You can’t perform that action at this time.
0 commit comments