Skip to content

Commit cb65393

Browse files
author
Denis Gursky
committed
Revert "added autonumber support"
This reverts commit 0271783.
1 parent 0271783 commit cb65393

File tree

4 files changed

+9
-131
lines changed

4 files changed

+9
-131
lines changed

src/results/integration.test.ts

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,21 @@ import {
3131
} from './tests';
3232

3333
describe('Integration', () => {
34+
const databaseName = `js-sdk-tests-${Date.now()}`;
3435
const engineName = getEngineName();
35-
let databaseName: string;
3636
let client: Client;
3737

38-
function setup() {
39-
beforeAll(async () => {
40-
client = await getClient();
38+
beforeAll(async () => {
39+
client = await getClient();
4140

42-
databaseName = `js-sdk-tests-${Date.now()}`;
43-
44-
await createDatabaseIfNotExists(client, databaseName);
45-
});
41+
await createDatabaseIfNotExists(client, databaseName);
42+
});
4643

47-
afterAll(async () => {
48-
await client.deleteDatabase(databaseName);
49-
});
50-
}
44+
afterAll(async () => {
45+
await client.deleteDatabase(databaseName);
46+
});
5147

5248
describe('Rel to JS standard types', () => {
53-
setup();
54-
5549
standardTypeTests.forEach(test => {
5650
const testFn = test.skip ? it.skip : test.only ? it.only : it;
5751

@@ -72,8 +66,6 @@ describe('Integration', () => {
7266
});
7367

7468
describe('Rel to JS specialization', () => {
75-
setup();
76-
7769
specializationTests.forEach(test => {
7870
const testFn = test.skip ? it.skip : test.only ? it.only : it;
7971

@@ -94,8 +86,6 @@ describe('Integration', () => {
9486
});
9587

9688
describe('Rel to JS value types', () => {
97-
setup();
98-
9989
valueTypeTests.forEach(test => {
10090
const testFn = test.skip ? it.skip : test.only ? it.only : it;
10191

@@ -116,8 +106,6 @@ describe('Integration', () => {
116106
});
117107

118108
describe('Rel to JS value types misc', () => {
119-
setup();
120-
121109
miscValueTypeTests.forEach(test => {
122110
const testFn = test.skip ? it.skip : test.only ? it.only : it;
123111

@@ -138,8 +126,6 @@ describe('Integration', () => {
138126
});
139127

140128
describe('Rel to JS value types specialization', () => {
141-
setup();
142-
143129
valueTypeSpecializationTests.forEach(test => {
144130
const testFn = test.skip ? it.skip : test.only ? it.only : it;
145131

src/results/resultUtils.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ export function convertValue<T extends RelTypedValue>(
205205
case 'UInt16':
206206
case 'UInt32':
207207
case 'UInt64':
208-
case 'AutoNumber':
209208
return value;
210209
case 'UInt128':
211210
return uint128ToBigInt(Array.from(value));
@@ -328,7 +327,6 @@ export function getDisplayValue(
328327
case 'UInt128':
329328
case 'FilePos':
330329
case 'Hash':
331-
case 'AutoNumber':
332330
return val.value.toString();
333331
case 'Missing':
334332
return 'missing';
@@ -542,12 +540,7 @@ function mapValueType(typeDef: Omit<ValueTypeValue, 'value'>): RelTypeDef {
542540
return { type: 'Rational128' };
543541
}
544542
}
545-
break;
546543
}
547-
case 'AutoNumber':
548-
return {
549-
type: standardValueType,
550-
};
551544
}
552545

553546
return typeDef;

src/results/tests.ts

Lines changed: 0 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -576,20 +576,6 @@ export const standardTypeTests: Test[] = [
576576
],
577577
displayValues: ['123456789101112313/9123456789101112313'],
578578
},
579-
{
580-
name: 'AutoNumber',
581-
query: `
582-
def num = auto_number["a"]
583-
def output(x) = num(_, x)
584-
`,
585-
typeDefs: [
586-
{
587-
type: 'AutoNumber',
588-
},
589-
],
590-
values: [1n],
591-
displayValues: ['1'],
592-
},
593579
];
594580

595581
export const specializationTests: Test[] = [
@@ -1387,25 +1373,6 @@ export const specializationTests: Test[] = [
13871373
],
13881374
displayValues: ['123456789101112313/9123456789101112313'],
13891375
},
1390-
{
1391-
name: 'AutoNumber',
1392-
query: `
1393-
def num = auto_number["a"]
1394-
def v(x) = num(_, x)
1395-
def output = #(v)
1396-
`,
1397-
typeDefs: [
1398-
{
1399-
type: 'Constant',
1400-
value: {
1401-
type: 'AutoNumber',
1402-
value: 1n,
1403-
},
1404-
},
1405-
],
1406-
values: [1n],
1407-
displayValues: ['1'],
1408-
},
14091376
];
14101377

14111378
export const valueTypeTests: Test[] = [
@@ -2530,34 +2497,6 @@ export const valueTypeTests: Test[] = [
25302497
],
25312498
displayValues: ['(:MyType, 1, 123456789101112313/9123456789101112313)'],
25322499
},
2533-
{
2534-
name: 'AutoNumber',
2535-
query: `
2536-
def num = auto_number["a"]
2537-
def anum(x) = num(_, x)
2538-
value type MyType = Int, AutoNumber
2539-
def output = ^MyType[1, anum]
2540-
`,
2541-
typeDefs: [
2542-
{
2543-
type: 'ValueType',
2544-
typeDefs: [
2545-
{
2546-
type: 'Constant',
2547-
value: { type: 'String', value: ':MyType' },
2548-
},
2549-
{
2550-
type: 'Int64',
2551-
},
2552-
{
2553-
type: 'AutoNumber',
2554-
},
2555-
],
2556-
},
2557-
],
2558-
values: [[':MyType', 1n, 1n]],
2559-
displayValues: ['(:MyType, 1, 1)'],
2560-
},
25612500
];
25622501

25632502
export const miscValueTypeTests: Test[] = [
@@ -4073,37 +4012,4 @@ export const valueTypeSpecializationTests: Test[] = [
40734012
],
40744013
displayValues: ['(:MyType, 123456789101112313/9123456789101112313, 1)'],
40754014
},
4076-
{
4077-
name: 'AutoNumber',
4078-
query: `
4079-
def num = auto_number["a"]
4080-
def anum(x) = num(_, x)
4081-
value type MyType = AutoNumber, Int
4082-
def v = ^MyType[anum, 1]
4083-
def output = #(v)
4084-
`,
4085-
typeDefs: [
4086-
{
4087-
type: 'Constant',
4088-
value: {
4089-
type: 'ValueType',
4090-
typeDefs: [
4091-
{
4092-
type: 'Constant',
4093-
value: { type: 'String', value: ':MyType' },
4094-
},
4095-
{
4096-
type: 'AutoNumber',
4097-
},
4098-
{
4099-
type: 'Int64',
4100-
},
4101-
],
4102-
value: [':MyType', 1n, 1n],
4103-
},
4104-
},
4105-
],
4106-
values: [[':MyType', 1n, 1n]],
4107-
displayValues: ['(:MyType, 1, 1)'],
4108-
},
41094015
];

src/results/types.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ export type RelBaseTypedValue =
5959
| Rational16Value
6060
| Rational32Value
6161
| Rational64Value
62-
| Rational128Value
63-
| AutoNumber;
62+
| Rational128Value;
6463

6564
export type RelTypedValue = RelBaseTypedValue | ValueTypeValue | UnknownType;
6665

@@ -105,7 +104,6 @@ export type RelTypeDef =
105104
| Omit<Rational32Value, 'value'>
106105
| Omit<Rational64Value, 'value'>
107106
| Omit<Rational128Value, 'value'>
108-
| Omit<AutoNumber, 'value'>
109107
| ConstantValue
110108
| Omit<ValueTypeValue, 'value'>
111109
| Omit<UnknownType, 'value'>;
@@ -340,11 +338,6 @@ export type Rational128Value = {
340338
};
341339
};
342340

343-
export type AutoNumber = {
344-
type: 'AutoNumber';
345-
value: bigint;
346-
};
347-
348341
// TODO: should be removed with JSON based metadata implementation?
349342
export type UnknownType = {
350343
type: 'Unknown';

0 commit comments

Comments
 (0)