Repository navigation
Expand file tree
/
Copy pathencrypt.test.js
More file actions
executable file
·695 lines (594 loc) · 22 KB
/
Copy pathencrypt.test.js
File metadata and controls
executable file
·695 lines (594 loc) · 22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
'use strict'
import { createRequire } from 'module'
import chaiAsPromised from 'chai-as-promised'
const require = createRequire(import.meta.url)
const { TestEnv } = require('./env/test-env')
const env = new TestEnv()
const chai = require('chai')
chai.use(chaiAsPromised)
const expect = chai.expect
const sql = require('../lib/sql')
const { configureTestLogging } = require('./common/logging-helper')
// Configure logging based on environment variables
// By default, tests run silently. To enable logging:
// - MSNODESQLV8_TEST_VERBOSE=true npm test (for full trace logging)
// - MSNODESQLV8_TEST_LOG_LEVEL=DEBUG MSNODESQLV8_TEST_LOG_CONSOLE=true npm test
// - MSNODESQLV8_TEST_LOG_LEVEL=INFO MSNODESQLV8_TEST_LOG_FILE=/tmp/test.log npm test
configureTestLogging(sql)
describe('encrypt', function () {
this.timeout(50000)
this.beforeEach(async function () {
sql.logger.info('Starting test setup', 'params.test.beforeEach')
await env.open()
sql.logger.info('Test environment opened successfully', 'params.test.beforeEach')
})
this.afterEach(async function () {
sql.logger.info('Starting test cleanup', 'params.test.afterEach')
await env.close()
sql.logger.info('Test environment closed successfully', 'params.test.afterEach')
})
const encryptHelper = env.encryptHelper
class FieldBuilder {
tableName = null
procName = null
constructor () {
this.tableName = 'test_encrpted_table'
this.procName = `proc_insert_${this.tableName}`
}
makeProcParams (i) {
i = i || 0
return {
field: this.makeValue(i)
}
}
checkEqual (lhs, rhs) {
expect(lhs).to.deep.equals(rhs)
}
build (builder) {}
makeValue (i) {}
}
class EncryptionFieldTester {
builder = null
fieldBuilder = null
constructor (fieldBuilder) {
this.fieldBuilder = fieldBuilder
}
async makeBuilder () {
const mgr = env.theConnection.tableMgr()
const dbName = await env.getDbName()
const builder = mgr.makeBuilder(this.fieldBuilder.tableName, dbName)
builder.addColumn('id').asInt().isIdentity(1, 1).notNull()
this.fieldBuilder.build(builder)
return builder
}
noID (res) {
const { id, ...rest } = res
return rest
}
async prepare () {
const procname = this.fieldBuilder.procName
this.builder = await this.makeBuilder()
this.table = this.builder.toTable()
const builder = this.builder
await builder.drop()
await builder.create()
const procSql = builder.insertProcSql(procname)
const promises = env.theConnection.promises
const procDef2 = {
name: procname,
sql: procSql
}
const procTest = env.procTest(procDef2)
await procTest.drop()
await procTest.create()
await promises.query(`exec sp_refresh_parameter_encryption ${procDef2.name}`)
}
make (rows) {
rows = rows || 50
return Array(rows).fill(0).map((_, i) => {
const builder = this.fieldBuilder
return builder.makeProcParams(i)
})
}
async testTable (rows) {
rows = rows || 1
const expected = this.make(rows)
const promises = this.table.promises
const tableName = this.fieldBuilder.tableName
await promises.insert(expected)
await this.selectCheck(tableName, expected)
}
async selectCheck (tableName, expected) {
const conPromises = env.theConnection.promises
const actual = await conPromises.query(`select * from ${tableName} `)
expect(actual.first.length).to.equals(expected.length)
for (let i = 0; i < expected.length; ++i) {
this.fieldBuilder.checkEqual(this.noID(actual.first[i]), expected[i])
}
}
async testProc () {
const procParams = this.fieldBuilder.makeProcParams()
const procname = this.fieldBuilder.procName
const promises = env.theConnection.promises
const res = await promises.callProc(procname, procParams)
this.fieldBuilder.checkEqual(this.noID(res.first[0]), procParams)
const res2 = await promises.query(`select * from ${this.fieldBuilder.tableName} `)
this.fieldBuilder.checkEqual(this.noID(res2.first[0]), procParams)
}
}
/**
* CREATE TABLE [dbo].[test_encrpted_table](
* [id] [int] IDENTITY(1,1) NOT NULL,
* [BusinessEntityID] [int] NULL,
* [NationalIDNumber] [nvarchar](15) COLLATE Latin1_General_BIN2 ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NOT NULL,
* [LoginID] [nvarchar](256) COLLATE Latin1_General_BIN2 ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NOT NULL,
* [OrganizationNode] [hierarchyid] NULL,
* [OrganizationLevel] AS ([OrganizationNode].[GetLevel]()),
* [JobTitle] [nvarchar](50) COLLATE Latin1_General_BIN2 ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NOT NULL,
* [BirthDate] [date] ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NOT NULL,
* [MaritalStatus] [char](1) COLLATE Latin1_General_BIN2 ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NOT NULL,
* [Gender] [char](1) COLLATE Latin1_General_BIN2 ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NOT NULL,
* [HireDate] [date] ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NOT NULL,
* [SalariedFlag] [bit] ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NOT NULL,
* [VacationHours] [smallint] ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NOT NULL,
* [SickLeaveHours] [smallint] ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NOT NULL,
* [CurrentFlag] [bit] ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NOT NULL,
* [rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
* [ModifiedDate] [datetime2](7) ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NOT NULL
* ) ON [PRIMARY]
* */
/**
* create procedure [dbo].[proc_insert_test_encrpted_table]
* (
* @BusinessEntityID int ,
* @NationalIDNumber nvarchar (15) ,
* @LoginID nvarchar (256) ,
* @OrganizationNode hierarchyid ,
* @JobTitle nvarchar (50) ,
* @BirthDate date ,
* @MaritalStatus char (1) ,
* @Gender char (1) ,
* @HireDate date ,
* @SalariedFlag bit ,
* @VacationHours smallint ,
* @SickLeaveHours smallint ,
* @CurrentFlag bit ,
* @rowguid uniqueidentifier ,
* @ModifiedDate datetime2
* )
* as
* begin
* declare @ae_BusinessEntityID int = @BusinessEntityID
* declare @ae_NationalIDNumber nvarchar (15) = @NationalIDNumber
* declare @ae_LoginID nvarchar (256) = @LoginID
* declare @ae_OrganizationNode hierarchyid = @OrganizationNode
* declare @ae_JobTitle nvarchar (50) = @JobTitle
* declare @ae_BirthDate date = @BirthDate
* declare @ae_MaritalStatus char (1) = @MaritalStatus
* declare @ae_Gender char (1) = @Gender
* declare @ae_HireDate date = @HireDate
* declare @ae_SalariedFlag bit = @SalariedFlag
* declare @ae_VacationHours smallint = @VacationHours
* declare @ae_SickLeaveHours smallint = @SickLeaveHours
* declare @ae_CurrentFlag bit = @CurrentFlag
* declare @ae_rowguid uniqueidentifier = @rowguid
* declare @ae_ModifiedDate datetime2 = @ModifiedDate
* insert into node.dbo.test_encrpted_table (BusinessEntityID, NationalIDNumber, LoginID, OrganizationNode, JobTitle, BirthDate, MaritalStatus, Gender, HireDate, SalariedFlag, VacationHours, SickLeaveHours, CurrentFlag, rowguid, ModifiedDate)
* output inserted.*
* values (@ae_BusinessEntityID, @ae_NationalIDNumber, @ae_LoginID, @ae_OrganizationNode, @ae_JobTitle, @ae_BirthDate, @ae_MaritalStatus, @ae_Gender, @ae_HireDate, @ae_SalariedFlag, @ae_VacationHours, @ae_SickLeaveHours, @ae_CurrentFlag, @ae_rowguid, @ae_ModifiedDate)
* end
*
*/
class FieldBuilderEmployee extends FieldBuilder {
constructor () {
super()
const employee = env.employee
this.records = employee.make(250)
}
noOrgLevel (v) {
const { OrganizationLevel, ...rest } = v
return rest
}
makeProcParams (i) {
i = i || 0
const v = this.makeValue(i)
return this.noOrgLevel(v)
}
checkEqual (lhs, rhs) {
expect(this.noOrgLevel(lhs)).to.deep.equals(this.noOrgLevel(rhs))
}
build (builder) {
builder.addColumn('[BusinessEntityID]').asInt().isPrimaryKey(1)
builder.addColumn('[NationalIDNumber]').asNVarChar(15).withDecorator(encryptHelper.txtWithEncrypt).notNull()
builder.addColumn('[LoginID]').asNVarChar(256).withDecorator(encryptHelper.txtWithEncrypt).notNull()
builder.addColumn('[OrganizationNode]').asHierarchyId().null()
builder.addColumn('[OrganizationLevel]').asInt().asExpression('AS ([OrganizationNode].[GetLevel]())')
builder.addColumn('[JobTitle]').asNVarChar(50).withDecorator(encryptHelper.txtWithEncrypt).notNull()
builder.addColumn('[BirthDate]').asDate().withDecorator(encryptHelper.fieldWithEncrpyt).notNull()
builder.addColumn('[MaritalStatus]').asChar(1).withDecorator(encryptHelper.txtWithEncrypt).notNull()
builder.addColumn('[Gender]').asChar(1).withDecorator(encryptHelper.txtWithEncrypt).notNull()
builder.addColumn('[HireDate]').asDate().withDecorator(encryptHelper.fieldWithEncrpyt).notNull()
builder.addColumn('[SalariedFlag]').asBit().withDecorator(encryptHelper.fieldWithEncrpyt).notNull()
builder.addColumn('[VacationHours]').asSmallInt().withDecorator(encryptHelper.fieldWithEncrpyt).notNull()
builder.addColumn('[SickLeaveHours]').asSmallInt().withDecorator(encryptHelper.fieldWithEncrpyt).notNull()
builder.addColumn('[CurrentFlag]').asBit().withDecorator(encryptHelper.fieldWithEncrpyt).notNull()
builder.addColumn('[rowguid]').asUniqueIdentifier().withDecorator('ROWGUIDCOL NOT NULL')
builder.addColumn('[ModifiedDate]').asDateTime2().withDecorator(encryptHelper.fieldWithEncrpyt).notNull()
}
makeValue (i) {
return this.records[i % this.records.length]
}
}
class FieldBuilderFloat extends FieldBuilder {
constructor (val) {
super()
this.value = val || 12.1234
}
checkEqual (lhs, rhs) {
expect(lhs.field).closeTo(rhs.field, 1e-5)
}
build (builder) {
builder.addColumn('field').asFloat().withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue (i) {
return i % 2 === 0
? this.value
: -this.value
}
}
class FieldBuilderReal extends FieldBuilder {
constructor (val) {
super()
this.value = val || -12.1234
}
checkEqual (lhs, rhs) {
expect(lhs.field).closeTo(rhs.field, 1e-5)
}
build (builder) {
builder.addColumn('field').asReal().withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue (i) {
return i % 2 === 0 ? this.value : -this.value
}
}
class FieldBuilderNumeric extends FieldBuilder {
constructor (val) {
super()
this.value = val || 12.12345678901234
}
checkEqual (lhs, rhs) {
expect(lhs.field).closeTo(rhs.field, 1e-7)
}
build (builder) {
builder.addColumn('field').asNumeric(20, 15).withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue (i) {
return i % 2 === 0
? this.value
: -this.value
}
}
class FieldBuilderDecimal extends FieldBuilder {
build (builder) {
builder.addColumn('field').asDecimal(20, 18).withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue (i) {
const divisor = ((i % 10) + 1) * 2
return 12.123456789 / divisor
}
}
class FieldBuilderBit extends FieldBuilder {
build (builder) {
builder.addColumn('field').asBit().withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue (i) {
return i % 2 === 0
}
}
class FieldBuilderBigInt extends FieldBuilder {
build (builder) {
builder.addColumn('field').asBigInt().withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue (i) {
const addition = (i % 10) * 4 + i
const v = 1234567890123 + addition
const sign = i % 2 === 0 ? 1 : -1
return v * sign
}
}
class FieldBuilderTinyInt extends FieldBuilder {
build (builder) {
builder.addColumn('field').asTinyInt().withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue (i) {
const addition = (i % 10)
const v = (200 + addition) % 255
return v
}
}
class FieldBuilderInt extends FieldBuilder {
build (builder) {
builder.addColumn('field').asInt().withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue (i) {
const addition = (i % 10)
const v = 12345 + addition
const sign = i % 2 === 0 ? 1 : -1
return v * sign
}
}
class FieldBuilderSmallInt extends FieldBuilder {
build (builder) {
builder.addColumn('field').asSmallInt().withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue (i) {
const addition = (i % 10)
const v = 123 + addition
const sign = i % 2 === 0 ? 1 : -1
return v * sign
}
}
class FieldBuilderChar extends FieldBuilder {
build (builder) {
builder.addColumn('field').asChar(10).withDecorator(encryptHelper.txtWithEncrypt)
}
makeValue (i) {
return i % 2 === 0
? '0123456789'
: '9876543220'
}
}
class FieldBuilderNVarChar extends FieldBuilder {
build (builder) {
builder.addColumn('field').asNVarChar(50).withDecorator(encryptHelper.txtWithEncrypt)
}
makeValue (i) {
return i % 2 === 0
? 'hello world!'
: 'goodbye cruel world!'
}
}
class FieldBuilderVarBinary extends FieldBuilder {
build (builder) {
builder.addColumn('field').asVarBinary(50).withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue () {
return Buffer.from('5AE178', 'hex')
}
}
class FieldBuilderBinary extends FieldBuilder {
build (builder) {
builder.addColumn('field').asBinary(3).withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue () {
return Buffer.from('5AE178', 'hex')
}
}
class FieldBuilderDate extends FieldBuilder {
value = null
constructor (val) {
super()
this.value = val || env.timeHelper.getUTCDate(new Date())
}
build (builder) {
builder.addColumn('field').asDate().withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue (i) {
const offset = i % 10
const result = new Date(this.value)
result.setDate(result.getDate() - offset)
return this.value
}
}
class FieldBuilderDateTimeOffset extends FieldBuilder {
value = null
constructor (val) {
super()
this.value = val || env.timeHelper.getUTCDateHHMMSS(new Date())
}
build (builder) {
builder.addColumn('field').asDateTimeOffset().withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue (i) {
const offset = i % 10
const result = new Date(this.value)
result.setDate(result.getDate() - offset)
return this.value
}
}
class FieldBuilderDateTime2 extends FieldBuilder {
value = null
constructor (val) {
super()
this.value = val || env.timeHelper.getUTCDateHHMMSS(new Date())
}
build (builder) {
builder.addColumn('field').asDateTime2().withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue (i) {
const offset = i % 10
const result = new Date(this.value)
result.setDate(result.getDate() - offset)
return this.value
}
}
class FieldBuilderTime extends FieldBuilder {
value = null
constructor (scale) {
super()
this.scale = scale
this.value = scale >= 3
? env.timeHelper.getUTCTime1970HHMMSSMS(new Date())
: env.timeHelper.getUTCTime1970HHMMSS(new Date())
}
build (builder) {
builder.addColumn('field').asTime(this.scale).withDecorator(encryptHelper.fieldWithEncrpyt)
}
makeValue (i) {
return this.value
}
}
async function runProc (fieldBuilder) {
if (!env.isEncryptedConnection()) return
const tester = new EncryptionFieldTester(fieldBuilder)
await tester.prepare()
await tester.testProc()
}
async function runTable (fieldBuilder) {
if (!env.isEncryptedConnection()) return
const tester = new EncryptionFieldTester(fieldBuilder)
await tester.prepare()
await tester.testTable()
}
it('encrypted UTC datetimeoffset via proc', async function handler () {
await runProc(new FieldBuilderDateTimeOffset())
})
it('encrypted UTC datetimeoffset via table', async function handler () {
await runTable(new FieldBuilderDateTimeOffset())
})
it('encrypted employee via table', async function handler () {
await runTable(new FieldBuilderEmployee())
})
it('encrypted employee via proc', async function handler () {
await runProc(new FieldBuilderEmployee())
})
it('encrypted float via proc', async function handler () {
await runProc(new FieldBuilderFloat())
})
/*
it('encrypted float via table', async function handler () {
await runTable(new FieldBuilderFloat())
}) */
it('encrypted time(0) via proc', async function handler () {
await runProc(new FieldBuilderTime(0))
})
it('encrypted time(3) via proc', async function handler () {
await runProc(new FieldBuilderTime(3))
})
it('encrypted time(4) via proc', async function handler () {
await runProc(new FieldBuilderTime(4))
})
it('encrypted time(7) via proc', async function handler () {
await runProc(new FieldBuilderTime(7))
})
it('encrypted time(0) array via table', async function handler () {
await runTable(new FieldBuilderTime(0))
})
it('encrypted time(7) array via table', async function handler () {
await runTable(new FieldBuilderTime(7))
})
it('encrypted date via proc', async function handler () {
await runProc(new FieldBuilderDate())
})
it('encrypted date via table', async function handler () {
await runTable(new FieldBuilderDate())
})
it('encrypted real via proc', async function handler () {
await runProc(new FieldBuilderReal())
})
it('encrypted real via table', async function handler () {
await runTable(new FieldBuilderReal())
})
it('encrypted UTC datetime2 via proc', async function handler () {
await runProc(new FieldBuilderDateTime2())
})
it('encrypted UTC datetime2 via table', async function handler () {
await runTable(new FieldBuilderDateTime2())
})
it('encrypted numeric -12.12345 via proc',
async function handler () {
await runProc(new FieldBuilderNumeric(-12.12345))
})
it('encrypted numeric 12.12345 via proc',
async function handler () {
await runProc(new FieldBuilderNumeric(12.12345))
})
it('encrypted numeric 12.12345678901234 via proc',
async function handler () {
await runProc(new FieldBuilderNumeric())
})
it('encrypted numeric via table',
async function handler () {
await runTable(new FieldBuilderNumeric())
})
it('encrypted binary via proc',
async function handler () {
await runProc(new FieldBuilderBinary())
})
it('encrypted binary via table',
async function handler () {
await runTable(new FieldBuilderBinary())
})
it('encrypted varbinary via proc',
async function handler () {
await runProc(new FieldBuilderVarBinary())
})
it('encrypted varbinary via table',
async function handler () {
await runTable(new FieldBuilderVarBinary())
})
it('encrypted decimal via proc',
async function handler () {
await runProc(new FieldBuilderDecimal())
})
it('encrypted decimal via table',
async function handler () {
await runTable(new FieldBuilderDecimal())
})
it('encrypted nvarchar via proc',
async function handler () {
await runProc(new FieldBuilderNVarChar())
})
it('encrypted nvarchar via table',
async function handler () {
await runTable(new FieldBuilderNVarChar())
})
it('encrypted char 10 via proc',
async function handler () {
await runProc(new FieldBuilderChar())
})
it('encrypted char 10 via table',
async function handler () {
await runTable(new FieldBuilderChar())
})
it('encrypted bit via proc',
async function handler () {
await runProc(new FieldBuilderBit())
})
it('encrypted bit via table',
async function handler () {
await runTable(new FieldBuilderBit())
})
it('encrypted big int via proc',
async function handler () {
await runProc(new FieldBuilderBigInt())
})
it('encrypted big int via table',
async function handler () {
await runTable(new FieldBuilderBigInt())
})
it('encrypted tiny int via proc',
async function handler () {
await runProc(new FieldBuilderTinyInt())
})
it('encrypted tiny int via table',
async function handler () {
await runTable(new FieldBuilderTinyInt())
})
it('encrypted small int via proc',
async function handler () {
await runProc(new FieldBuilderSmallInt())
})
it('encrypted small int via table',
async function handler () {
await runTable(new FieldBuilderSmallInt())
})
it('encrypted int via proc',
async function handler () {
await runProc(new FieldBuilderInt())
})
it('encrypted int via table',
async function handler () {
await runTable(new FieldBuilderInt())
})
})