@tmlmobilidade/databases 20260618.2315.12 → 20260620.1032.31
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/dist/interfaces/apex/simplified/simplified-apex-banking-taps.d.ts +5 -2
- package/dist/interfaces/apex/simplified/simplified-apex-banking-taps.js +3 -2
- package/dist/interfaces/apex/simplified/simplified-apex-inspection-decisions.d.ts +5 -2
- package/dist/interfaces/apex/simplified/simplified-apex-inspection-decisions.js +3 -2
- package/dist/interfaces/apex/simplified/simplified-apex-inspections.d.ts +5 -2
- package/dist/interfaces/apex/simplified/simplified-apex-inspections.js +3 -2
- package/dist/interfaces/apex/simplified/simplified-apex-locations.d.ts +5 -2
- package/dist/interfaces/apex/simplified/simplified-apex-locations.js +3 -2
- package/dist/interfaces/apex/simplified/simplified-apex-refunds.d.ts +5 -2
- package/dist/interfaces/apex/simplified/simplified-apex-refunds.js +3 -2
- package/dist/interfaces/apex/simplified/simplified-apex-sales.d.ts +5 -2
- package/dist/interfaces/apex/simplified/simplified-apex-sales.js +3 -2
- package/dist/interfaces/apex/simplified/simplified-apex-validations.d.ts +5 -2
- package/dist/interfaces/apex/simplified/simplified-apex-validations.js +3 -2
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/performance/demand/demand-by-agency-by-operational-date.d.ts +29 -0
- package/dist/interfaces/performance/demand/demand-by-agency-by-operational-date.js +50 -0
- package/dist/interfaces/performance/demand/index.d.ts +1 -0
- package/dist/interfaces/performance/demand/index.js +1 -0
- package/dist/interfaces/performance/index.d.ts +1 -0
- package/dist/interfaces/performance/index.js +1 -0
- package/dist/types/clickhouse/data-types.d.ts +1 -1
- package/package.json +2 -1
|
@@ -5,8 +5,8 @@ declare class SimplifiedApexBankingTapsNewClass extends ClickHouseInterfaceTempl
|
|
|
5
5
|
private static _instance;
|
|
6
6
|
protected readonly databaseName = "simplified_apex";
|
|
7
7
|
protected readonly engine: ClickHouseTableEngine<SimplifiedApexBankingTap>;
|
|
8
|
-
protected readonly orderBy = "agency_id, created_at, _id";
|
|
9
|
-
protected readonly partitionBy = "
|
|
8
|
+
protected readonly orderBy = "agency_id, operational_date, created_at, _id";
|
|
9
|
+
protected readonly partitionBy = "intDiv(operational_date, 100)";
|
|
10
10
|
protected readonly schema: ClickHouseTableSchema<{
|
|
11
11
|
is_ok: boolean;
|
|
12
12
|
_id: string;
|
|
@@ -28,6 +28,9 @@ declare class SimplifiedApexBankingTapsNewClass extends ClickHouseInterfaceTempl
|
|
|
28
28
|
line_id: string | null;
|
|
29
29
|
mac_ase_counter_value: number;
|
|
30
30
|
mac_sam_serial_number: number;
|
|
31
|
+
operational_date: number & {
|
|
32
|
+
__brand: "OperationalDateInt";
|
|
33
|
+
};
|
|
31
34
|
pattern_id: string | null;
|
|
32
35
|
product_id: string | null;
|
|
33
36
|
stop_id: string;
|
|
@@ -19,6 +19,7 @@ const tableSchema = {
|
|
|
19
19
|
line_id: { type: 'LowCardinality(String)' },
|
|
20
20
|
mac_ase_counter_value: { type: 'UInt64' },
|
|
21
21
|
mac_sam_serial_number: { type: 'UInt64' },
|
|
22
|
+
operational_date: { type: 'UInt32' },
|
|
22
23
|
pattern_id: { type: 'LowCardinality(String)' },
|
|
23
24
|
product_id: { type: 'LowCardinality(String)' },
|
|
24
25
|
received_at: { type: 'DateTime64(3, \'UTC\') CODEC(Delta, ZSTD)' },
|
|
@@ -33,8 +34,8 @@ class SimplifiedApexBankingTapsNewClass extends ClickHouseInterfaceTemplate {
|
|
|
33
34
|
static _instance = null;
|
|
34
35
|
databaseName = 'simplified_apex';
|
|
35
36
|
engine = 'ReplacingMergeTree(updated_at)';
|
|
36
|
-
orderBy = 'agency_id, created_at, _id';
|
|
37
|
-
partitionBy = '
|
|
37
|
+
orderBy = 'agency_id, operational_date, created_at, _id';
|
|
38
|
+
partitionBy = 'intDiv(operational_date, 100)';
|
|
38
39
|
schema = tableSchema;
|
|
39
40
|
tableName = 'banking_taps';
|
|
40
41
|
/**
|
|
@@ -5,8 +5,8 @@ declare class SimplifiedApexInspectionDecisionsNewClass extends ClickHouseInterf
|
|
|
5
5
|
private static _instance;
|
|
6
6
|
protected readonly databaseName = "simplified_apex";
|
|
7
7
|
protected readonly engine: ClickHouseTableEngine<SimplifiedApexInspectionDecision>;
|
|
8
|
-
protected readonly orderBy = "agency_id, created_at, _id";
|
|
9
|
-
protected readonly partitionBy = "
|
|
8
|
+
protected readonly orderBy = "agency_id, operational_date, created_at, _id";
|
|
9
|
+
protected readonly partitionBy = "intDiv(operational_date, 100)";
|
|
10
10
|
protected readonly schema: ClickHouseTableSchema<{
|
|
11
11
|
is_ok: boolean;
|
|
12
12
|
_id: string;
|
|
@@ -22,6 +22,9 @@ declare class SimplifiedApexInspectionDecisionsNewClass extends ClickHouseInterf
|
|
|
22
22
|
is_ok_pcgi: boolean;
|
|
23
23
|
mac_ase_counter_value: number;
|
|
24
24
|
mac_sam_serial_number: number;
|
|
25
|
+
operational_date: number & {
|
|
26
|
+
__brand: "OperationalDateInt";
|
|
27
|
+
};
|
|
25
28
|
updated_at: number & {
|
|
26
29
|
__brand: "UnixTimestamp";
|
|
27
30
|
};
|
|
@@ -15,6 +15,7 @@ const tableSchema = {
|
|
|
15
15
|
is_ok_pcgi: { type: 'Bool' },
|
|
16
16
|
mac_ase_counter_value: { type: 'UInt64' },
|
|
17
17
|
mac_sam_serial_number: { type: 'UInt64' },
|
|
18
|
+
operational_date: { type: 'UInt32' },
|
|
18
19
|
received_at: { type: 'DateTime64(3, \'UTC\') CODEC(Delta, ZSTD)' },
|
|
19
20
|
updated_at: { type: 'DateTime64(3, \'UTC\') CODEC(Delta, ZSTD)' },
|
|
20
21
|
};
|
|
@@ -24,8 +25,8 @@ class SimplifiedApexInspectionDecisionsNewClass extends ClickHouseInterfaceTempl
|
|
|
24
25
|
static _instance = null;
|
|
25
26
|
databaseName = 'simplified_apex';
|
|
26
27
|
engine = 'ReplacingMergeTree(updated_at)';
|
|
27
|
-
orderBy = 'agency_id, created_at, _id';
|
|
28
|
-
partitionBy = '
|
|
28
|
+
orderBy = 'agency_id, operational_date, created_at, _id';
|
|
29
|
+
partitionBy = 'intDiv(operational_date, 100)';
|
|
29
30
|
schema = tableSchema;
|
|
30
31
|
tableName = 'inspection_decisions';
|
|
31
32
|
/**
|
|
@@ -5,8 +5,8 @@ declare class SimplifiedApexInspectionsNewClass extends ClickHouseInterfaceTempl
|
|
|
5
5
|
private static _instance;
|
|
6
6
|
protected readonly databaseName = "simplified_apex";
|
|
7
7
|
protected readonly engine: ClickHouseTableEngine<SimplifiedApexInspection>;
|
|
8
|
-
protected readonly orderBy = "agency_id, created_at, _id";
|
|
9
|
-
protected readonly partitionBy = "
|
|
8
|
+
protected readonly orderBy = "agency_id, operational_date, created_at, _id";
|
|
9
|
+
protected readonly partitionBy = "intDiv(operational_date, 100)";
|
|
10
10
|
protected readonly schema: ClickHouseTableSchema<{
|
|
11
11
|
is_ok: boolean;
|
|
12
12
|
_id: string;
|
|
@@ -23,6 +23,9 @@ declare class SimplifiedApexInspectionsNewClass extends ClickHouseInterfaceTempl
|
|
|
23
23
|
line_id: string;
|
|
24
24
|
mac_ase_counter_value: number;
|
|
25
25
|
mac_sam_serial_number: number;
|
|
26
|
+
operational_date: number & {
|
|
27
|
+
__brand: "OperationalDateInt";
|
|
28
|
+
};
|
|
26
29
|
pattern_id: string | null;
|
|
27
30
|
product_id: string | null;
|
|
28
31
|
trip_id: string | null;
|
|
@@ -20,6 +20,7 @@ const tableSchema = {
|
|
|
20
20
|
line_id: { type: 'LowCardinality(Nullable(String))' },
|
|
21
21
|
mac_ase_counter_value: { type: 'UInt64' },
|
|
22
22
|
mac_sam_serial_number: { type: 'UInt64' },
|
|
23
|
+
operational_date: { type: 'UInt32' },
|
|
23
24
|
pattern_id: { type: 'LowCardinality(Nullable(String))' },
|
|
24
25
|
product_id: { type: 'LowCardinality(Nullable(String))' },
|
|
25
26
|
received_at: { type: 'DateTime64(3, \'UTC\') CODEC(Delta, ZSTD)' },
|
|
@@ -33,8 +34,8 @@ class SimplifiedApexInspectionsNewClass extends ClickHouseInterfaceTemplate {
|
|
|
33
34
|
static _instance = null;
|
|
34
35
|
databaseName = 'simplified_apex';
|
|
35
36
|
engine = 'ReplacingMergeTree(updated_at)';
|
|
36
|
-
orderBy = 'agency_id, created_at, _id';
|
|
37
|
-
partitionBy = '
|
|
37
|
+
orderBy = 'agency_id, operational_date, created_at, _id';
|
|
38
|
+
partitionBy = 'intDiv(operational_date, 100)';
|
|
38
39
|
schema = tableSchema;
|
|
39
40
|
tableName = 'inspections';
|
|
40
41
|
/**
|
|
@@ -5,8 +5,8 @@ declare class SimplifiedApexLocationsNewClass extends ClickHouseInterfaceTemplat
|
|
|
5
5
|
private static _instance;
|
|
6
6
|
protected readonly databaseName = "simplified_apex";
|
|
7
7
|
protected readonly engine: ClickHouseTableEngine<SimplifiedApexLocation>;
|
|
8
|
-
protected readonly orderBy = "agency_id, created_at, _id";
|
|
9
|
-
protected readonly partitionBy = "
|
|
8
|
+
protected readonly orderBy = "agency_id, operational_date, created_at, _id";
|
|
9
|
+
protected readonly partitionBy = "intDiv(operational_date, 100)";
|
|
10
10
|
protected readonly schema: ClickHouseTableSchema<{
|
|
11
11
|
is_ok: boolean;
|
|
12
12
|
_id: string;
|
|
@@ -23,6 +23,9 @@ declare class SimplifiedApexLocationsNewClass extends ClickHouseInterfaceTemplat
|
|
|
23
23
|
line_id: string;
|
|
24
24
|
mac_ase_counter_value: number;
|
|
25
25
|
mac_sam_serial_number: number;
|
|
26
|
+
operational_date: number & {
|
|
27
|
+
__brand: "OperationalDateInt";
|
|
28
|
+
};
|
|
26
29
|
pattern_id: string;
|
|
27
30
|
stop_id: string;
|
|
28
31
|
trip_id: string | null;
|
|
@@ -14,6 +14,7 @@ const tableSchema = {
|
|
|
14
14
|
line_id: { type: 'LowCardinality(Nullable(String))' },
|
|
15
15
|
mac_ase_counter_value: { type: 'UInt64' },
|
|
16
16
|
mac_sam_serial_number: { type: 'UInt64' },
|
|
17
|
+
operational_date: { type: 'UInt32' },
|
|
17
18
|
pattern_id: { type: 'LowCardinality(Nullable(String))' },
|
|
18
19
|
received_at: { type: 'DateTime64(3, \'UTC\') CODEC(Delta, ZSTD)' },
|
|
19
20
|
stop_id: { type: 'LowCardinality(Nullable(String))' },
|
|
@@ -27,8 +28,8 @@ class SimplifiedApexLocationsNewClass extends ClickHouseInterfaceTemplate {
|
|
|
27
28
|
static _instance = null;
|
|
28
29
|
databaseName = 'simplified_apex';
|
|
29
30
|
engine = 'ReplacingMergeTree(updated_at)';
|
|
30
|
-
orderBy = 'agency_id, created_at, _id';
|
|
31
|
-
partitionBy = '
|
|
31
|
+
orderBy = 'agency_id, operational_date, created_at, _id';
|
|
32
|
+
partitionBy = 'intDiv(operational_date, 100)';
|
|
32
33
|
schema = tableSchema;
|
|
33
34
|
tableName = 'locations';
|
|
34
35
|
/**
|
|
@@ -5,8 +5,8 @@ declare class SimplifiedApexOnBoardRefundsNewClass extends ClickHouseInterfaceTe
|
|
|
5
5
|
private static _instance;
|
|
6
6
|
protected readonly databaseName = "simplified_apex";
|
|
7
7
|
protected readonly engine: ClickHouseTableEngine<SimplifiedApexOnBoardRefund>;
|
|
8
|
-
protected readonly orderBy = "agency_id, created_at, _id";
|
|
9
|
-
protected readonly partitionBy = "
|
|
8
|
+
protected readonly orderBy = "agency_id, operational_date, created_at, _id";
|
|
9
|
+
protected readonly partitionBy = "intDiv(operational_date, 100)";
|
|
10
10
|
protected readonly schema: ClickHouseTableSchema<{
|
|
11
11
|
is_ok: boolean;
|
|
12
12
|
_id: string;
|
|
@@ -24,6 +24,9 @@ declare class SimplifiedApexOnBoardRefundsNewClass extends ClickHouseInterfaceTe
|
|
|
24
24
|
line_id: string | null;
|
|
25
25
|
mac_ase_counter_value: number;
|
|
26
26
|
mac_sam_serial_number: number;
|
|
27
|
+
operational_date: number & {
|
|
28
|
+
__brand: "OperationalDateInt";
|
|
29
|
+
};
|
|
27
30
|
pattern_id: string | null;
|
|
28
31
|
product_id: string;
|
|
29
32
|
stop_id: string | null;
|
|
@@ -17,6 +17,7 @@ const tableSchema = {
|
|
|
17
17
|
mac_ase_counter_value: { type: 'UInt64' },
|
|
18
18
|
mac_sam_serial_number: { type: 'UInt64' },
|
|
19
19
|
on_board_sale_id: { type: 'Nullable(UUID)' },
|
|
20
|
+
operational_date: { type: 'UInt32' },
|
|
20
21
|
pattern_id: { type: 'LowCardinality(Nullable(String))' },
|
|
21
22
|
payment_method: { type: 'UInt8' },
|
|
22
23
|
price: { type: 'Int32' },
|
|
@@ -35,8 +36,8 @@ class SimplifiedApexOnBoardRefundsNewClass extends ClickHouseInterfaceTemplate {
|
|
|
35
36
|
static _instance = null;
|
|
36
37
|
databaseName = 'simplified_apex';
|
|
37
38
|
engine = 'ReplacingMergeTree(updated_at)';
|
|
38
|
-
orderBy = 'agency_id, created_at, _id';
|
|
39
|
-
partitionBy = '
|
|
39
|
+
orderBy = 'agency_id, operational_date, created_at, _id';
|
|
40
|
+
partitionBy = 'intDiv(operational_date, 100)';
|
|
40
41
|
schema = tableSchema;
|
|
41
42
|
tableName = 'refunds';
|
|
42
43
|
/**
|
|
@@ -5,8 +5,8 @@ declare class SimplifiedApexOnBoardSalesNewClass extends ClickHouseInterfaceTemp
|
|
|
5
5
|
private static _instance;
|
|
6
6
|
protected readonly databaseName = "simplified_apex";
|
|
7
7
|
protected readonly engine: ClickHouseTableEngine<SimplifiedApexOnBoardSale>;
|
|
8
|
-
protected readonly orderBy = "agency_id, created_at, _id";
|
|
9
|
-
protected readonly partitionBy = "
|
|
8
|
+
protected readonly orderBy = "agency_id, operational_date, created_at, _id";
|
|
9
|
+
protected readonly partitionBy = "intDiv(operational_date, 100)";
|
|
10
10
|
protected readonly schema: ClickHouseTableSchema<{
|
|
11
11
|
is_ok: boolean;
|
|
12
12
|
_id: string;
|
|
@@ -24,6 +24,9 @@ declare class SimplifiedApexOnBoardSalesNewClass extends ClickHouseInterfaceTemp
|
|
|
24
24
|
line_id: string | null;
|
|
25
25
|
mac_ase_counter_value: number;
|
|
26
26
|
mac_sam_serial_number: number;
|
|
27
|
+
operational_date: number & {
|
|
28
|
+
__brand: "OperationalDateInt";
|
|
29
|
+
};
|
|
27
30
|
pattern_id: string | null;
|
|
28
31
|
product_id: string;
|
|
29
32
|
stop_id: string | null;
|
|
@@ -18,6 +18,7 @@ const tableSchema = {
|
|
|
18
18
|
mac_ase_counter_value: { type: 'UInt64' },
|
|
19
19
|
mac_sam_serial_number: { type: 'UInt64' },
|
|
20
20
|
on_board_refund_id: { type: 'Nullable(UUID)' },
|
|
21
|
+
operational_date: { type: 'UInt32' },
|
|
21
22
|
pattern_id: { type: 'LowCardinality(Nullable(String))' },
|
|
22
23
|
payment_method: { type: 'UInt8' },
|
|
23
24
|
price: { type: 'Int32' },
|
|
@@ -36,8 +37,8 @@ class SimplifiedApexOnBoardSalesNewClass extends ClickHouseInterfaceTemplate {
|
|
|
36
37
|
static _instance = null;
|
|
37
38
|
databaseName = 'simplified_apex';
|
|
38
39
|
engine = 'ReplacingMergeTree(updated_at)';
|
|
39
|
-
orderBy = 'agency_id, created_at, _id';
|
|
40
|
-
partitionBy = '
|
|
40
|
+
orderBy = 'agency_id, operational_date, created_at, _id';
|
|
41
|
+
partitionBy = 'intDiv(operational_date, 100)';
|
|
41
42
|
schema = tableSchema;
|
|
42
43
|
tableName = 'sales';
|
|
43
44
|
/**
|
|
@@ -5,8 +5,8 @@ declare class SimplifiedApexValidationsNewClass extends ClickHouseInterfaceTempl
|
|
|
5
5
|
private static _instance;
|
|
6
6
|
protected readonly databaseName = "simplified_apex";
|
|
7
7
|
protected readonly engine: ClickHouseTableEngine<SimplifiedApexValidation>;
|
|
8
|
-
protected readonly orderBy = "agency_id, created_at, _id";
|
|
9
|
-
protected readonly partitionBy = "
|
|
8
|
+
protected readonly orderBy = "agency_id, operational_date, created_at, _id";
|
|
9
|
+
protected readonly partitionBy = "intDiv(operational_date, 100)";
|
|
10
10
|
protected readonly schema: ClickHouseTableSchema<{
|
|
11
11
|
is_passenger: boolean;
|
|
12
12
|
is_ok: boolean;
|
|
@@ -26,6 +26,9 @@ declare class SimplifiedApexValidationsNewClass extends ClickHouseInterfaceTempl
|
|
|
26
26
|
line_id: string | null;
|
|
27
27
|
mac_ase_counter_value: number;
|
|
28
28
|
mac_sam_serial_number: number;
|
|
29
|
+
operational_date: number & {
|
|
30
|
+
__brand: "OperationalDateInt";
|
|
31
|
+
};
|
|
29
32
|
pattern_id: string | null;
|
|
30
33
|
product_id: string | null;
|
|
31
34
|
stop_id: string | null;
|
|
@@ -20,6 +20,7 @@ const tableSchema = {
|
|
|
20
20
|
mac_sam_serial_number: { type: 'UInt64' },
|
|
21
21
|
on_board_refund_id: { type: 'Nullable(UUID)' },
|
|
22
22
|
on_board_sale_id: { type: 'Nullable(UUID)' },
|
|
23
|
+
operational_date: { type: 'UInt32' },
|
|
23
24
|
pattern_id: { type: 'LowCardinality(Nullable(String))' },
|
|
24
25
|
product_id: { type: 'LowCardinality(Nullable(String))' },
|
|
25
26
|
received_at: { type: 'DateTime64(3, \'UTC\') CODEC(Delta, ZSTD)' },
|
|
@@ -36,8 +37,8 @@ class SimplifiedApexValidationsNewClass extends ClickHouseInterfaceTemplate {
|
|
|
36
37
|
static _instance = null;
|
|
37
38
|
databaseName = 'simplified_apex';
|
|
38
39
|
engine = 'ReplacingMergeTree(updated_at)';
|
|
39
|
-
orderBy = 'agency_id, created_at, _id';
|
|
40
|
-
partitionBy = '
|
|
40
|
+
orderBy = 'agency_id, operational_date, created_at, _id';
|
|
41
|
+
partitionBy = 'intDiv(operational_date, 100)';
|
|
41
42
|
schema = tableSchema;
|
|
42
43
|
tableName = 'validations';
|
|
43
44
|
/**
|
package/dist/interfaces/index.js
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ClickHouseInterfaceTemplate } from '../../../templates/clickhouse.js';
|
|
2
|
+
import { type ClickHouseTableEngine, type ClickHouseTableSchema } from '../../../types/index.js';
|
|
3
|
+
import { type DemandByAgencyByOperationalDate } from '@tmlmobilidade/go-types-performance';
|
|
4
|
+
declare class DemandByAgencyByOperationalDateClass extends ClickHouseInterfaceTemplate<DemandByAgencyByOperationalDate> {
|
|
5
|
+
private static _instance;
|
|
6
|
+
protected readonly databaseName = "performance";
|
|
7
|
+
protected readonly engine: ClickHouseTableEngine<DemandByAgencyByOperationalDate>;
|
|
8
|
+
protected readonly orderBy = "operational_date, agency_id";
|
|
9
|
+
protected readonly partitionBy = "intDiv(operational_date, 100)";
|
|
10
|
+
protected readonly schema: ClickHouseTableSchema<{
|
|
11
|
+
agency_id: string;
|
|
12
|
+
operational_date: string & {
|
|
13
|
+
__brand: "OperationalDate";
|
|
14
|
+
};
|
|
15
|
+
qty: number;
|
|
16
|
+
updated_at: number & {
|
|
17
|
+
__brand: "UnixTimestamp";
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
protected readonly tableName = "demand_by_agency_by_operational_date";
|
|
21
|
+
/**
|
|
22
|
+
* Returns the singleton instance of the subclass.
|
|
23
|
+
*/
|
|
24
|
+
static getInstance(): Promise<DemandByAgencyByOperationalDateClass>;
|
|
25
|
+
protected connectToClient(): Promise<import("@clickhouse/client").ClickHouseClient>;
|
|
26
|
+
protected postInit(): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
export declare const demandByAgencyByOperationalDate: DemandByAgencyByOperationalDateClass;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { GOClickHouseClient } from '../../../clients/go-clickhouse.js';
|
|
3
|
+
import { ClickHouseInterfaceTemplate } from '../../../templates/clickhouse.js';
|
|
4
|
+
import { asyncSingletonProxy } from '@tmlmobilidade/utils';
|
|
5
|
+
/* * */
|
|
6
|
+
const tableSchema = {
|
|
7
|
+
agency_id: { type: 'LowCardinality(String)' },
|
|
8
|
+
operational_date: { type: 'UInt32' },
|
|
9
|
+
qty: { type: 'UInt64' },
|
|
10
|
+
updated_at: { type: 'DateTime64(3, \'UTC\') CODEC(Delta, ZSTD)' },
|
|
11
|
+
};
|
|
12
|
+
/* * */
|
|
13
|
+
class DemandByAgencyByOperationalDateClass extends ClickHouseInterfaceTemplate {
|
|
14
|
+
//
|
|
15
|
+
static _instance = null;
|
|
16
|
+
databaseName = 'performance';
|
|
17
|
+
engine = 'ReplacingMergeTree(updated_at)';
|
|
18
|
+
orderBy = 'operational_date, agency_id';
|
|
19
|
+
partitionBy = 'intDiv(operational_date, 100)';
|
|
20
|
+
schema = tableSchema;
|
|
21
|
+
tableName = 'demand_by_agency_by_operational_date';
|
|
22
|
+
/**
|
|
23
|
+
* Returns the singleton instance of the subclass.
|
|
24
|
+
*/
|
|
25
|
+
static async getInstance() {
|
|
26
|
+
// If no instance exists, create one and store the promise.
|
|
27
|
+
// This ensures that if multiple calls to getInstance() happen concurrently,
|
|
28
|
+
// they will all await the same initialization process.
|
|
29
|
+
if (!this._instance) {
|
|
30
|
+
this._instance = (async () => {
|
|
31
|
+
const instance = new DemandByAgencyByOperationalDateClass();
|
|
32
|
+
// This behaves like the constructor,
|
|
33
|
+
// but allows for async initialization.
|
|
34
|
+
await instance.init();
|
|
35
|
+
return instance;
|
|
36
|
+
})();
|
|
37
|
+
}
|
|
38
|
+
// Await the instance if it's still initializing,
|
|
39
|
+
// or return it immediately if ready.
|
|
40
|
+
return await this._instance;
|
|
41
|
+
}
|
|
42
|
+
connectToClient() {
|
|
43
|
+
return GOClickHouseClient.getClient();
|
|
44
|
+
}
|
|
45
|
+
async postInit() {
|
|
46
|
+
console.log('Post init ClickHouse service for Demand by Agency by Operational Date...');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/* * */
|
|
50
|
+
export const demandByAgencyByOperationalDate = asyncSingletonProxy(DemandByAgencyByOperationalDateClass);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './demand-by-agency-by-operational-date.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './demand-by-agency-by-operational-date.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './demand/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './demand/index.js';
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Supported ClickHouse data types that
|
|
3
3
|
* can be used in ClickHouse table schemas.
|
|
4
4
|
*/
|
|
5
|
-
export type ClickHouseDataType = 'Bool' | 'Date' | 'Float64' | 'Int32' | 'Int64' | 'String' | 'UInt8' | 'UInt64' | 'UUID' | `DateTime64(3, 'UTC') CODEC(Delta, ZSTD)` | `Enum8(${string})` | `LowCardinality(Nullable(String))` | `LowCardinality(String)` | `Nullable(Float64)` | `Nullable(Int32)` | `Nullable(Int64)` | `Nullable(String)` | `Nullable(UInt64)` | `Nullable(UUID)`;
|
|
5
|
+
export type ClickHouseDataType = 'Bool' | 'Date' | 'Float64' | 'Int32' | 'Int64' | 'String' | 'UInt8' | 'UInt32' | 'UInt64' | 'UUID' | `DateTime64(3, 'UTC') CODEC(Delta, ZSTD)` | `Enum8(${string})` | `LowCardinality(Nullable(String))` | `LowCardinality(String)` | `Nullable(Float64)` | `Nullable(Int32)` | `Nullable(Int64)` | `Nullable(String)` | `Nullable(UInt64)` | `Nullable(UUID)`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmlmobilidade/databases",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20260620.1032.31",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "iso@tmlmobilidade.pt",
|
|
6
6
|
"name": "TML-ISO"
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@clickhouse/client": "1.21.0",
|
|
40
40
|
"@tmlmobilidade/go-types-apex": "*",
|
|
41
|
+
"@tmlmobilidade/go-types-performance": "*",
|
|
41
42
|
"@tmlmobilidade/logger": "*",
|
|
42
43
|
"@tmlmobilidade/ssh": "*",
|
|
43
44
|
"@tmlmobilidade/types": "*",
|