@pi-r/mssql 0.5.2 → 0.5.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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2023 Wit Studio
1
+ Copyright 2023 Haruhi Suzumiya
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @pi-r/mssql
2
2
 
3
- PEP 402 - Forever Vivy
3
+ PEP 402 - Forever
4
4
 
5
5
  ## LICENSE
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/mssql",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "MSSQL client driver for E-mc.",
5
5
  "main": "client/index.js",
6
6
  "types": "client/index.d.ts",
@@ -21,8 +21,8 @@
21
21
  "license": "MIT",
22
22
  "homepage": "https://github.com/anpham6/pi-r#readme",
23
23
  "dependencies": {
24
- "@e-mc/db": "^0.7.2",
25
- "@e-mc/types": "^0.7.2",
24
+ "@e-mc/db": "^0.7.3",
25
+ "@e-mc/types": "^0.7.3",
26
26
  "tedious": "^16.7.1",
27
27
  "tedious-connection-pool2": "^2.1.0"
28
28
  }
package/types/index.d.ts CHANGED
@@ -2,7 +2,9 @@ import type { DbDataSource } from '@e-mc/types/lib/squared';
2
2
 
3
3
  import type { ExecuteAction, ServerAuth } from '@e-mc/types/lib/db';
4
4
 
5
+ // @ts-ignore
5
6
  import type { ConnectionConfig, ParameterOptions, TediousType, TediousTypes } from 'tedious';
7
+ // @ts-ignore
6
8
  import type { PoolConfig } from 'tedious-connection-pool';
7
9
 
8
10
  export interface MSSQLDataSource extends DbDataSource<string, unknown, unknown, string | MSSQLCredential, string | PoolConfig>, ExecuteAction<MSSQLRequestParameters | MSSQLRequestWithOutputParameters> {
@@ -0,0 +1,69 @@
1
+ /* eslint @typescript-eslint/consistent-type-imports: "off" */
2
+
3
+ import type { Connection, ConnectionConfiguration } from 'tedious';
4
+
5
+ import type * as EventEmitter from 'events';
6
+
7
+ declare class Pool extends EventEmitter {
8
+ /**
9
+ * Connection Pool constructor
10
+ * @param poolConfig the pool configuration
11
+ * @param connectionConfig the connection configuration
12
+ */
13
+ constructor(poolConfig: Pool.PoolConfig, connectionConfig: ConnectionConfiguration);
14
+
15
+ /**
16
+ * acquires a connection from the pool
17
+ * @param callback invoked when the connection is retrieved and ready
18
+ */
19
+ acquire(callback: (err: Error, connection: Pool.PooledConnection) => void): void;
20
+
21
+ /**
22
+ * closes opened connections
23
+ */
24
+ drain(): void;
25
+ }
26
+
27
+ declare namespace Pool {
28
+
29
+ export class PooledConnection extends Connection {
30
+ /**
31
+ * If the connection is issued from a connection pool returns the connection to the pool.
32
+ */
33
+ release(): void;
34
+ }
35
+
36
+ export interface PoolConfig {
37
+ /**
38
+ * Minimum concurrent connections
39
+ */
40
+ min?: number | undefined;
41
+
42
+ /**
43
+ * Maximum concurrent connections
44
+ */
45
+ max?: number | undefined;
46
+
47
+ /**
48
+ * Defines if logging is activated
49
+ */
50
+ log?: boolean | undefined;
51
+
52
+ /**
53
+ * Idle timeout
54
+ */
55
+ idleTimeout?: number | undefined;
56
+
57
+ /**
58
+ * Retry delay
59
+ */
60
+ retryDelay?: number | undefined;
61
+
62
+ /**
63
+ * Acquire timeout
64
+ */
65
+ acquireTimeout?: number | undefined;
66
+ }
67
+ }
68
+
69
+ export = Pool;