update long numbers

This commit is contained in:
Simon Larsen 2023-10-24 10:56:41 +01:00
parent 0bdab474de
commit 842b0664c7
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
6 changed files with 20 additions and 7 deletions

View File

@ -9,6 +9,7 @@ enum ColumnType {
Decimal = 'Decimal',
ArrayNumber = 'Array of Numbers',
ArrayText = 'Array of Text',
LongNumber = 'Long Number',
}
export default ColumnType;

View File

@ -249,6 +249,10 @@ export default class StatementGenerator<TBaseModel extends AnalyticsBaseModel> {
.join(', ')})`;
}
if(column.type === TableColumnType.JSON) {
value = `'${JSON.stringify(value)}'`;
}
return value;
}
@ -395,6 +399,10 @@ export default class StatementGenerator<TBaseModel extends AnalyticsBaseModel> {
return 'DateTime';
}
if (type === TableColumnType.JSON) {
return 'JSON';
}
if (type === TableColumnType.NestedModel) {
return 'Nested';
}
@ -407,6 +415,10 @@ export default class StatementGenerator<TBaseModel extends AnalyticsBaseModel> {
return 'Array(String)';
}
if(type === TableColumnType.LongNumber) {
return 'Int128';
}
throw new BadDataException('Unknown column type: ' + type);
}

View File

@ -42,7 +42,7 @@ export default class Log extends AnalyticsBaseModel {
title: 'Time (in Unix Nano)',
description: 'When was the log created?',
required: true,
type: TableColumnType.Number,
type: TableColumnType.LongNumber,
}),
new AnalyticsTableColumn({

View File

@ -68,7 +68,7 @@ export default class Metric extends AnalyticsBaseModel {
title: 'Time (in Unix Nano)',
description: 'When did the Metric happen?',
required: false,
type: TableColumnType.Number,
type: TableColumnType.LongNumber,
}),
new AnalyticsTableColumn({
@ -76,7 +76,7 @@ export default class Metric extends AnalyticsBaseModel {
title: 'Start Time (in Unix Nano)',
description: 'When did the Metric happen?',
required: false,
type: TableColumnType.Number,
type: TableColumnType.LongNumber,
}),
new AnalyticsTableColumn({

View File

@ -68,7 +68,7 @@ export default class Metric extends AnalyticsBaseModel {
title: 'Time (in Unix Nano)',
description: 'When did the Metric happen?',
required: false,
type: TableColumnType.Number,
type: TableColumnType.LongNumber,
}),
new AnalyticsTableColumn({
@ -76,7 +76,7 @@ export default class Metric extends AnalyticsBaseModel {
title: 'Start Time (in Unix Nano)',
description: 'When did the Metric happen?',
required: true,
type: TableColumnType.Number,
type: TableColumnType.LongNumber,
}),
new AnalyticsTableColumn({

View File

@ -151,7 +151,7 @@ export default class Span extends AnalyticsBaseModel {
title: 'Start Time in Unix Nano',
description: 'When did the span start?',
required: false,
type: TableColumnType.Number,
type: TableColumnType.LongNumber,
}),
new AnalyticsTableColumn({
@ -159,7 +159,7 @@ export default class Span extends AnalyticsBaseModel {
title: 'End Time',
description: 'When did the span end?',
required: false,
type: TableColumnType.Number,
type: TableColumnType.LongNumber,
}),
new AnalyticsTableColumn({