Skip to content

Commit 4f4f57c

Browse files
authored
Fix typing + documentation for reuseConnections (#301)
Signed-off-by: Myron Ng <49994092+myronng@users.noreply.github.com>
1 parent a863b69 commit 4f4f57c

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,11 @@ Note that `odbc.pool` will return from callback or Promise as soon as it has cre
692692
* **connectionString**: The connection string to connect to the database for all connections in the pool, usually by naming a DSN. Can also be a configuration object with the following properties:
693693
* `connectionString` **REQUIRED**: The connection string to connect to the database
694694
* `connectionTimeout`: The number of seconds to wait for a request on the connection to complete before returning to the application
695-
* `loginTimeout`:The number of seconds to wait for a login request to complete before returning to the application
695+
* `loginTimeout`: The number of seconds to wait for a login request to complete before returning to the application
696696
* `initialSize`: The initial number of Connections created in the Pool
697697
* `incrementSize`: How many additional Connections to create when all of the Pool's connections are taken
698698
* `maxSize`: The maximum number of open Connections the Pool will create
699+
* `reuseConnections`: Whether or not to reuse an existing Connection instead of creating a new one
699700
* `shrink`: Whether or not the number of Connections should shrink to `initialSize` as they free up
700701
* **callback?**: The function called when `.connect` has finished connecting. If no callback function is given, `.connect` will return a native JavaScript `Promise`. Callback signature is:
701702
* error: The error that occured in execution, or `null` if no error

lib/odbc.d.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ declare namespace odbc {
4545
////////////////////////////////////////////////////////////////////////////
4646

4747
prepare(sql:string): Promise<void>;
48-
48+
4949
bind(parameters: Array<number|string>): Promise<void>;
50-
50+
5151
execute<T>(): Promise<Result<T>>;
52-
52+
5353
close(): Promise<void>;
5454
}
5555

@@ -65,14 +65,15 @@ declare namespace odbc {
6565
initialSize?: number;
6666
incrementSize?: number;
6767
maxSize?: number;
68+
reuseConnections?: boolean;
6869
shrink?: boolean;
6970
}
7071

7172
interface QueryOptions {
7273
cursor?: boolean|string;
7374
fetchSize?: number;
7475
timeout?: number;
75-
initialBufferSize?: number;
76+
initialBufferSize?: number;
7677
}
7778

7879
interface CursorQueryOptions extends QueryOptions {
@@ -173,21 +174,21 @@ declare namespace odbc {
173174

174175
class Cursor {
175176
noData: boolean
176-
177+
177178
////////////////////////////////////////////////////////////////////////////
178179
// Promises ////////////////////////////////////////////////////////////
179180
////////////////////////////////////////////////////////////////////////////
180-
181+
181182
fetch<T>(): Promise<Result<T>>
182-
183+
183184
close(): Promise<void>
184-
185+
185186
////////////////////////////////////////////////////////////////////////////
186187
// Callbacks ///////////////////////////////////////////////////////////
187188
////////////////////////////////////////////////////////////////////////////
188-
189+
189190
fetch<T>(callback: (error: NodeOdbcError, result: Result<T>) => undefined): undefined
190-
191+
191192
close(callback: (error: NodeOdbcError) => undefined): undefined
192193
}
193194

0 commit comments

Comments
 (0)