• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

typeorm / typeorm / 22256862981

21 Feb 2026 12:31PM UTC coverage: 81.291% (+0.1%) from 81.176%
22256862981

push

github

web-flow
feat!: remove deprecated `Connection` and `ConnectionOptions` (#12022)

27682 of 33521 branches covered (82.58%)

Branch coverage included in aggregate %.

1205 of 1301 new or added lines in 76 files covered. (92.62%)

1 existing line in 1 file now uncovered.

93920 of 116068 relevant lines covered (80.92%)

71235.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/driver/sqlserver/SqlServerDataSourceOptions.ts
1
import { BaseDataSourceOptions } from "../../data-source/BaseDataSourceOptions"
×
2
import { ReplicationMode } from "../types/ReplicationMode"
×
3
import { SqlServerConnectionCredentialsOptions } from "./SqlServerConnectionCredentialsOptions"
×
4

×
5
/**
×
6
 * Microsoft Sql Server specific connection options.
×
7
 */
×
NEW
8
export interface SqlServerDataSourceOptions
×
9
    extends BaseDataSourceOptions, SqlServerConnectionCredentialsOptions {
×
10
    /**
×
11
     * Database type.
×
12
     */
×
13
    readonly type: "mssql"
×
14

×
15
    /**
×
16
     * Connection timeout in ms (default: 15000).
×
17
     */
×
18
    readonly connectionTimeout?: number
×
19

×
20
    /**
×
21
     * Request timeout in ms (default: 15000). NOTE: msnodesqlv8 driver doesn't support timeouts < 1 second.
×
22
     */
×
23
    readonly requestTimeout?: number
×
24

×
25
    /**
×
26
     * Stream recordsets/rows instead of returning them all at once as an argument of callback (default: false).
×
27
     * You can also enable streaming for each request independently (request.stream = true).
×
28
     * Always set to true if you plan to work with large amount of rows.
×
29
     */
×
30
    readonly stream?: boolean
×
31

×
32
    /**
×
33
     * Database schema.
×
34
     */
×
35
    readonly schema?: string
×
36

×
37
    /**
×
38
     * The driver object
×
39
     * This defaults to `require("mssql")`
×
40
     */
×
41
    readonly driver?: any
×
42

×
43
    /**
×
44
     * An optional object/dictionary with the any of the properties
×
45
     */
×
46
    readonly pool?: {
×
47
        /**
×
48
         * Maximum number of resources to create at any given time. (default=1)
×
49
         */
×
50
        readonly max?: number
×
51

×
52
        /**
×
53
         * Minimum number of resources to keep in pool at any given time. If this is set >= max, the pool will silently
×
54
         * set the min to equal max. (default=0)
×
55
         */
×
56
        readonly min?: number
×
57

×
58
        /**
×
59
         * Maximum number of queued requests allowed, additional acquire calls will be callback with an err in a future
×
60
         * cycle of the event loop.
×
61
         */
×
62
        readonly maxWaitingClients?: number
×
63

×
64
        /**
×
65
         * Max milliseconds an acquire call will wait for a resource before timing out. (default no limit), if supplied should non-zero positive integer.
×
66
         */
×
67
        readonly acquireTimeoutMillis?: number
×
68

×
69
        /**
×
70
         * If true the oldest resources will be first to be allocated. If false the most recently released resources will
×
71
         * be the first to be allocated. This in effect turns the pool's behaviour from a queue into a stack. boolean,
×
72
         * (default true)
×
73
         */
×
74
        readonly fifo?: boolean
×
75

×
76
        /**
×
77
         * Int between 1 and x - if set, borrowers can specify their relative priority in the queue if no resources
×
78
         * are available. see example. (default 1)
×
79
         */
×
80
        readonly priorityRange?: number
×
81

×
82
        /**
×
83
         * How often to run eviction checks. Default: 0 (does not run).
×
84
         */
×
85
        readonly evictionRunIntervalMillis?: number
×
86

×
87
        /**
×
88
         * Number of resources to check each eviction run. Default: 3.
×
89
         */
×
90
        readonly numTestsPerRun?: number
×
91

×
92
        /**
×
93
         * Amount of time an object may sit idle in the pool before it is eligible for eviction by the idle object
×
94
         * evictor (if any), with the extra condition that at least "min idle" object instances remain in the pool.
×
95
         * Default -1 (nothing can get evicted)
×
96
         */
×
97
        readonly softIdleTimeoutMillis?: number
×
98

×
99
        /**
×
100
         * The minimum amount of time that an object may sit idle in the pool before it is eligible for eviction due
×
101
         * to idle time. Supercedes softIdleTimeoutMillis Default: 30000
×
102
         */
×
103
        readonly idleTimeoutMillis?: number
×
104

×
105
        /*
×
106
         * Function handling errors thrown by drivers pool.
×
107
         * Defaults to logging error with `warn` level.
×
108
         */
×
109
        readonly errorHandler?: (err: any) => any
×
110
    }
×
111

×
112
    /**
×
113
     * Extra options
×
114
     */
×
115
    readonly options?: {
×
116
        /**
×
117
         * The named instance to connect to
×
118
         */
×
119
        readonly instanceName?: string
×
120

×
121
        /**
×
122
         * By default, if the database requestion by options.database cannot be accessed, the connection will fail with
×
123
         * an error. However, if options.fallbackToDefaultDb is set to true, then the user's default database will
×
124
         * be used instead (Default: false).
×
125
         */
×
126
        readonly fallbackToDefaultDb?: boolean
×
127

×
128
        /**
×
129
         * If true, SET ANSI_NULL_DFLT_ON ON will be set in the initial sql. This means new columns will be nullable by
×
130
         * default. See the T-SQL documentation for more details. (Default: true).
×
131
         */
×
132
        readonly enableAnsiNullDefault?: boolean
×
133

×
134
        /**
×
135
         * The number of milliseconds before the attempt to connect is considered failed (default: 15000).
×
136
         */
×
137
        readonly connectTimeout?: number
×
138

×
139
        /**
×
140
         * The number of milliseconds before the cancel (abort) of a request is considered failed (default: 5000).
×
141
         */
×
142
        readonly cancelTimeout?: number
×
143

×
144
        /**
×
145
         * The size of TDS packets (subject to negotiation with the server). Should be a power of 2. (default: 4096).
×
146
         */
×
147
        readonly packetSize?: number
×
148

×
149
        /**
×
150
         * A boolean determining whether to pass time values in UTC or local time. (default: false).
×
151
         */
×
152
        readonly useUTC?: boolean
×
153

×
154
        /**
×
155
         * A boolean determining whether to rollback a transaction automatically if any error is encountered during
×
156
         * the given transaction's execution. This sets the value for SET XACT_ABORT during the initial SQL phase
×
157
         * of a connection (documentation).
×
158
         */
×
159
        readonly abortTransactionOnError?: boolean
×
160

×
161
        /**
×
162
         * A string indicating which network interface (ip address) to use when connecting to SQL Server.
×
163
         */
×
164
        readonly localAddress?: string
×
165

×
166
        /**
×
167
         * A boolean determining whether to return rows as arrays or key-value collections. (default: false).
×
168
         */
×
169
        readonly useColumnNames?: boolean
×
170

×
171
        /**
×
172
         * A boolean, controlling whether the column names returned will have the first letter converted to lower case
×
173
         * (true) or not. This value is ignored if you provide a columnNameReplacer. (default: false).
×
174
         */
×
175
        readonly camelCaseColumns?: boolean
×
176

×
177
        /**
×
178
         * A boolean, controlling whatever to disable RETURNING / OUTPUT statements.
×
179
         */
×
180
        readonly disableOutputReturning?: boolean
×
181

×
182
        /**
×
183
         * A boolean, controlling whether MssqlParameter types char, varchar, and text are converted to their unicode equivalents, nchar, nvarchar, and ntext.
×
184
         * (default: false, meaning that char/varchar/text parameters will be converted to nchar/nvarchar/ntext)
×
185
         */
×
186
        readonly disableAsciiToUnicodeParamConversion?: boolean
×
187

×
188
        /**
×
189
         * Debug options
×
190
         */
×
191
        readonly debug?: {
×
192
            /**
×
193
             * A boolean, controlling whether debug events will be emitted with text describing packet details
×
194
             * (default: false).
×
195
             */
×
196
            readonly packet?: boolean
×
197

×
198
            /**
×
199
             * A boolean, controlling whether debug events will be emitted with text describing packet data details
×
200
             * (default: false).
×
201
             */
×
202
            readonly data?: boolean
×
203

×
204
            /**
×
205
             * A boolean, controlling whether debug events will be emitted with text describing packet payload details
×
206
             * (default: false).
×
207
             */
×
208
            readonly payload?: boolean
×
209

×
210
            /**
×
211
             * A boolean, controlling whether debug events will be emitted with text describing token stream tokens
×
212
             * (default: false).
×
213
             */
×
214
            readonly token?: boolean
×
215
        }
×
216

×
217
        /**
×
218
         * The default isolation level that transactions will be run with. The isolation levels are available
×
219
         * from require('tedious').ISOLATION_LEVEL. (default: READ_COMMITTED).
×
220
         */
×
221
        readonly isolation?:
×
222
            | "READ_UNCOMMITTED"
×
223
            | "READ_COMMITTED"
×
224
            | "REPEATABLE_READ"
×
225
            | "SERIALIZABLE"
×
226
            | "SNAPSHOT"
×
227

×
228
        /**
×
229
         * The default isolation level for new connections. All out-of-transaction queries are executed with this
×
230
         * setting. The isolation levels are available from require('tedious').ISOLATION_LEVEL .
×
231
         */
×
232
        readonly connectionIsolationLevel?:
×
233
            | "READ_UNCOMMITTED"
×
234
            | "READ_COMMITTED"
×
235
            | "REPEATABLE_READ"
×
236
            | "SERIALIZABLE"
×
237
            | "SNAPSHOT"
×
238

×
239
        /**
×
240
         * A boolean, determining whether the connection will request read only access from a SQL Server
×
241
         * Availability Group. For more information, see here. (default: false).
×
242
         */
×
243
        readonly readOnlyIntent?: boolean
×
244

×
245
        /**
×
246
         * A boolean determining whether or not the connection will be encrypted. Set to true if you're on
×
247
         * Windows Azure. (default: true).
×
248
         */
×
249
        readonly encrypt?: boolean
×
250

×
251
        /**
×
252
         * When encryption is used, an object may be supplied that will be used for the first argument when calling
×
253
         * tls.createSecurePair (default: {}).
×
254
         */
×
255
        readonly cryptoCredentialsDetails?: any
×
256

×
257
        /**
×
258
         * A boolean, that when true will expose received rows in Requests' done* events. See done, doneInProc and
×
259
         * doneProc. (default: false)
×
260
         * Caution: If many row are received, enabling this option could result in excessive memory usage.
×
261
         */
×
262
        readonly rowCollectionOnDone?: boolean
×
263

×
264
        /**
×
265
         * A boolean, that when true will expose received rows in Requests' completion callback. See new Request. (default: false)
×
266
         * Caution: If many row are received, enabling this option could result in excessive memory usage.
×
267
         */
×
268
        readonly rowCollectionOnRequestCompletion?: boolean
×
269

×
270
        /**
×
271
         * The version of TDS to use. If server doesn't support specified version, negotiated version is used instead.
×
272
         * The versions are available from require('tedious').TDS_VERSION. (default: 7_4).
×
273
         */
×
274
        readonly tdsVersion?: string
×
275

×
276
        /**
×
277
         * A boolean, that when true will abort a query when an overflow or divide-by-zero error occurs during query execution.
×
278
         */
×
279
        readonly enableArithAbort?: boolean
×
280

×
281
        /**
×
282
         * Application name used for identifying a specific application in profiling, logging or tracing tools of SQL Server.
×
283
         * (default: node-mssql)
×
284
         */
×
285
        readonly appName?: string
×
286

×
287
        /**
×
288
         * A boolean, controlling whether encryption occurs if there is no verifiable server certificate.
×
289
         * (default: false)
×
290
         */
×
291
        readonly trustServerCertificate?: boolean
×
292

×
293
        /**
×
294
         * A boolean, controlling whether the driver should connect to all IPs returned from DNS in parallel.
×
295
         * (default: false)
×
296
         */
×
297
        readonly multiSubnetFailover?: boolean
×
298
    }
×
299

×
300
    /**
×
301
     * Replication setup.
×
302
     */
×
303
    readonly replication?: {
×
304
        /**
×
305
         * Master server used by orm to perform writes.
×
306
         */
×
307
        readonly master: SqlServerConnectionCredentialsOptions
×
308

×
309
        /**
×
310
         * List of read-from servers (slaves).
×
311
         */
×
312
        readonly slaves: SqlServerConnectionCredentialsOptions[]
×
313

×
314
        /**
×
315
         * Default connection pool to use for SELECT queries
×
316
         * @default "slave"
×
317
         */
×
318
        readonly defaultMode?: ReplicationMode
×
319
    }
×
320

×
321
    readonly poolSize?: never
×
322
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc