@pi-r/mssql 0.8.1 → 0.8.3
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/README.md +6 -6
- package/client/pool.d.ts +8 -8
- package/package.json +29 -29
- package/types/index.d.ts +33 -33
- package/types/pool.d.ts +66 -66
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
### @pi-r/mssql
|
|
2
|
-
|
|
3
|
-
https://e-mc.readthedocs.io/en/latest/db/mssql.html
|
|
4
|
-
|
|
5
|
-
### LICENSE
|
|
6
|
-
|
|
1
|
+
### @pi-r/mssql
|
|
2
|
+
|
|
3
|
+
https://e-mc.readthedocs.io/en/latest/db/mssql.html
|
|
4
|
+
|
|
5
|
+
### LICENSE
|
|
6
|
+
|
|
7
7
|
MIT
|
package/client/pool.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { DbPoolConstructor } from '@e-mc/types/lib/db';
|
|
2
|
-
|
|
3
|
-
import type { DbPoolCredential, MSSQLDataSource } from '../types';
|
|
4
|
-
|
|
5
|
-
import type * as mssql_pool from '../types/pool';
|
|
6
|
-
|
|
7
|
-
declare const MSSQLPool: DbPoolConstructor<MSSQLDataSource, mssql_pool, mssql_pool.PooledConnection, DbPoolCredential>;
|
|
8
|
-
|
|
1
|
+
import type { DbPoolConstructor } from '@e-mc/types/lib/db';
|
|
2
|
+
|
|
3
|
+
import type { DbPoolCredential, MSSQLDataSource } from '../types';
|
|
4
|
+
|
|
5
|
+
import type * as mssql_pool from '../types/pool';
|
|
6
|
+
|
|
7
|
+
declare const MSSQLPool: DbPoolConstructor<MSSQLDataSource, mssql_pool, mssql_pool.PooledConnection, DbPoolCredential>;
|
|
8
|
+
|
|
9
9
|
export = MSSQLPool;
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pi-r/mssql",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "MSSQL client driver for E-mc.",
|
|
5
|
-
"main": "client/index.js",
|
|
6
|
-
"types": "client/index.d.ts",
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"access": "public"
|
|
9
|
-
},
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/anpham6/pi-r.git",
|
|
13
|
-
"directory": "src/db/mssql"
|
|
14
|
-
},
|
|
15
|
-
"keywords": [
|
|
16
|
-
"squared",
|
|
17
|
-
"e-mc",
|
|
18
|
-
"squared-functions"
|
|
19
|
-
],
|
|
20
|
-
"author": "An Pham <anpham6@gmail.com>",
|
|
21
|
-
"license": "MIT",
|
|
22
|
-
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"@e-mc/db": "^0.10.
|
|
25
|
-
"@e-mc/types": "^0.10.
|
|
26
|
-
"tedious": "^18.6.2",
|
|
27
|
-
"tedious-connection-pool2": "^2.1.0"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@pi-r/mssql",
|
|
3
|
+
"version": "0.8.3",
|
|
4
|
+
"description": "MSSQL client driver for E-mc.",
|
|
5
|
+
"main": "client/index.js",
|
|
6
|
+
"types": "client/index.d.ts",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/anpham6/pi-r.git",
|
|
13
|
+
"directory": "src/db/mssql"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"squared",
|
|
17
|
+
"e-mc",
|
|
18
|
+
"squared-functions"
|
|
19
|
+
],
|
|
20
|
+
"author": "An Pham <anpham6@gmail.com>",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@e-mc/db": "^0.10.3",
|
|
25
|
+
"@e-mc/types": "^0.10.3",
|
|
26
|
+
"tedious": "^18.6.2",
|
|
27
|
+
"tedious-connection-pool2": "^2.1.0"
|
|
28
|
+
}
|
|
29
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/// <reference lib="es2022" />
|
|
2
|
-
|
|
3
|
-
import type { DbDataSource } from '@e-mc/types/lib/squared';
|
|
4
|
-
|
|
5
|
-
import type { IdentifierAction } from '@e-mc/types/lib/core';
|
|
6
|
-
import type { ExecuteAction, ServerAuth } from '@e-mc/types/lib/db';
|
|
7
|
-
|
|
8
|
-
import type { ConnectionConfiguration, TYPES } from 'tedious';
|
|
9
|
-
import type { DataType, ParameterData } from 'tedious/lib/data-type';
|
|
10
|
-
|
|
11
|
-
import type { PoolConfig } from './pool';
|
|
12
|
-
|
|
13
|
-
export interface MSSQLDataSource extends DbDataSource<string, unknown, unknown, MSSQLCredential, string | PoolConfig>, ExecuteAction<MSSQLRequestParameters | MSSQLRequestWithOutputParameters> {
|
|
14
|
-
source: "mssql";
|
|
15
|
-
storedProc?: boolean;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface MSSQLCredential extends ServerAuth, Omit<ConnectionConfiguration, "server"> {}
|
|
19
|
-
|
|
20
|
-
export interface MSSQLRequestWithOutputParameters {
|
|
21
|
-
input?: MSSQLRequestParameters;
|
|
22
|
-
output?: MSSQLRequestParameters;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface MSSQLRequestParameterValue {
|
|
26
|
-
name?: string;
|
|
27
|
-
value?: unknown;
|
|
28
|
-
type?: DataType;
|
|
29
|
-
options?: ParameterData;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export type MSSQLRequestParameters = Null<MSSQLRequestParameterValue[] | ObjectMap<Omit<MSSQLRequestParameterValue, "name">>>;
|
|
33
|
-
export type MSSQLDataType = keyof typeof TYPES;
|
|
1
|
+
/// <reference lib="es2022" />
|
|
2
|
+
|
|
3
|
+
import type { DbDataSource } from '@e-mc/types/lib/squared';
|
|
4
|
+
|
|
5
|
+
import type { IdentifierAction } from '@e-mc/types/lib/core';
|
|
6
|
+
import type { ExecuteAction, ServerAuth } from '@e-mc/types/lib/db';
|
|
7
|
+
|
|
8
|
+
import type { ConnectionConfiguration, TYPES } from 'tedious';
|
|
9
|
+
import type { DataType, ParameterData } from 'tedious/lib/data-type';
|
|
10
|
+
|
|
11
|
+
import type { PoolConfig } from './pool';
|
|
12
|
+
|
|
13
|
+
export interface MSSQLDataSource extends DbDataSource<string, unknown, unknown, MSSQLCredential, string | PoolConfig>, ExecuteAction<MSSQLRequestParameters | MSSQLRequestWithOutputParameters> {
|
|
14
|
+
source: "mssql";
|
|
15
|
+
storedProc?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface MSSQLCredential extends ServerAuth, Omit<ConnectionConfiguration, "server"> {}
|
|
19
|
+
|
|
20
|
+
export interface MSSQLRequestWithOutputParameters {
|
|
21
|
+
input?: MSSQLRequestParameters;
|
|
22
|
+
output?: MSSQLRequestParameters;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface MSSQLRequestParameterValue {
|
|
26
|
+
name?: string;
|
|
27
|
+
value?: unknown;
|
|
28
|
+
type?: DataType;
|
|
29
|
+
options?: ParameterData;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type MSSQLRequestParameters = Null<MSSQLRequestParameterValue[] | ObjectMap<Omit<MSSQLRequestParameterValue, "name">>>;
|
|
33
|
+
export type MSSQLDataType = keyof typeof TYPES;
|
|
34
34
|
export type DbPoolCredential = ConnectionConfiguration & IdentifierAction;
|
package/types/pool.d.ts
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import type { Connection, ConnectionConfiguration } from 'tedious';
|
|
2
|
-
|
|
3
|
-
import type * as EventEmitter from 'events';
|
|
4
|
-
|
|
5
|
-
declare class Pool extends EventEmitter {
|
|
6
|
-
/**
|
|
7
|
-
* Connection Pool constructor
|
|
8
|
-
* @param poolConfig the pool configuration
|
|
9
|
-
* @param connectionConfig the connection configuration
|
|
10
|
-
*/
|
|
11
|
-
constructor(poolConfig: Pool.PoolConfig, connectionConfig: ConnectionConfiguration);
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* acquires a connection from the pool
|
|
15
|
-
* @param callback invoked when the connection is retrieved and ready
|
|
16
|
-
*/
|
|
17
|
-
acquire(callback: (err: Error, connection: Pool.PooledConnection) => void): void;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* closes opened connections
|
|
21
|
-
*/
|
|
22
|
-
drain(): void;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
declare namespace Pool {
|
|
26
|
-
|
|
27
|
-
export class PooledConnection extends Connection {
|
|
28
|
-
/**
|
|
29
|
-
* If the connection is issued from a connection pool returns the connection to the pool.
|
|
30
|
-
*/
|
|
31
|
-
release(): void;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface PoolConfig {
|
|
35
|
-
/**
|
|
36
|
-
* Minimum concurrent connections
|
|
37
|
-
*/
|
|
38
|
-
min?: number | undefined;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Maximum concurrent connections
|
|
42
|
-
*/
|
|
43
|
-
max?: number | undefined;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Defines if logging is activated
|
|
47
|
-
*/
|
|
48
|
-
log?: boolean | undefined;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Idle timeout
|
|
52
|
-
*/
|
|
53
|
-
idleTimeout?: number | undefined;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Retry delay
|
|
57
|
-
*/
|
|
58
|
-
retryDelay?: number | undefined;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Acquire timeout
|
|
62
|
-
*/
|
|
63
|
-
acquireTimeout?: number | undefined;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
1
|
+
import type { Connection, ConnectionConfiguration } from 'tedious';
|
|
2
|
+
|
|
3
|
+
import type * as EventEmitter from 'events';
|
|
4
|
+
|
|
5
|
+
declare class Pool extends EventEmitter {
|
|
6
|
+
/**
|
|
7
|
+
* Connection Pool constructor
|
|
8
|
+
* @param poolConfig the pool configuration
|
|
9
|
+
* @param connectionConfig the connection configuration
|
|
10
|
+
*/
|
|
11
|
+
constructor(poolConfig: Pool.PoolConfig, connectionConfig: ConnectionConfiguration);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* acquires a connection from the pool
|
|
15
|
+
* @param callback invoked when the connection is retrieved and ready
|
|
16
|
+
*/
|
|
17
|
+
acquire(callback: (err: Error, connection: Pool.PooledConnection) => void): void;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* closes opened connections
|
|
21
|
+
*/
|
|
22
|
+
drain(): void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare namespace Pool {
|
|
26
|
+
|
|
27
|
+
export class PooledConnection extends Connection {
|
|
28
|
+
/**
|
|
29
|
+
* If the connection is issued from a connection pool returns the connection to the pool.
|
|
30
|
+
*/
|
|
31
|
+
release(): void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface PoolConfig {
|
|
35
|
+
/**
|
|
36
|
+
* Minimum concurrent connections
|
|
37
|
+
*/
|
|
38
|
+
min?: number | undefined;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Maximum concurrent connections
|
|
42
|
+
*/
|
|
43
|
+
max?: number | undefined;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Defines if logging is activated
|
|
47
|
+
*/
|
|
48
|
+
log?: boolean | undefined;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Idle timeout
|
|
52
|
+
*/
|
|
53
|
+
idleTimeout?: number | undefined;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Retry delay
|
|
57
|
+
*/
|
|
58
|
+
retryDelay?: number | undefined;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Acquire timeout
|
|
62
|
+
*/
|
|
63
|
+
acquireTimeout?: number | undefined;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
67
|
export = Pool;
|