@tmlmobilidade/databases 20260407.1655.55 → 20260408.1117.19

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.
@@ -6,7 +6,7 @@ import { validateSqlParam } from '../utils/clickhouse/validate-sql-param.js';
6
6
  import { Logger } from '@tmlmobilidade/logger';
7
7
  /* * */
8
8
  export class ClickHouseInterfaceTemplate {
9
- engine = 'ReplicatedMergeTree';
9
+ engine = 'MergeTree';
10
10
  orderBy = '_id';
11
11
  partitionBy = null;
12
12
  client;
@@ -194,7 +194,7 @@ export class ClickHouseInterfaceTemplate {
194
194
  await this.ensureDatabase();
195
195
  // Setup the full CREATE TABLE query
196
196
  const createTableQuery = `
197
- CREATE TABLE IF NOT EXISTS "${this.databaseName}"."${this.tableName}" ON CLUSTER default_cluster (
197
+ CREATE TABLE IF NOT EXISTS "${this.databaseName}"."${this.tableName}" (
198
198
  ${Object.entries(this.schema).map(([key, column]) => `${key} ${column.type}`).join(', ')}
199
199
  ) ENGINE = ${this.getEngineString()}
200
200
  ${this.orderBy ? `ORDER BY ${this.orderBy}` : ''}
@@ -216,8 +216,8 @@ export class ClickHouseInterfaceTemplate {
216
216
  */
217
217
  getEngineString() {
218
218
  switch (this.engine) {
219
- case 'ReplicatedMergeTree':
220
- return `ReplicatedMergeTree('/clickhouse/tables/{shard}/${this.databaseName}/${this.tableName}', '{replica}')`;
219
+ case 'MergeTree':
220
+ return `MergeTree()`;
221
221
  default:
222
222
  throw new Error(`CLICKHOUSE [${this.databaseName}/${this.tableName}]: Unsupported engine type: ${this.engine}`);
223
223
  }
@@ -2,6 +2,5 @@
2
2
  * Definition for allowed ClickHouse table engines.
3
3
  * Please avoid using other engines before consulting with the team
4
4
  * as ClickHouse has many engines with different features and limitations.
5
- * For example, only `ReplicatedMergeTree` supports automatic replication.
6
5
  */
7
- export type ClickHouseTableEngine = 'ReplicatedMergeTree';
6
+ export type ClickHouseTableEngine = 'MergeTree';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/databases",
3
- "version": "20260407.1655.55",
3
+ "version": "20260408.1117.19",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"