fix(core): update
This commit is contained in:
@ -2,19 +2,28 @@ import * as plugins from './smartclickhouse.plugins';
|
||||
import { SmartClickHouseDb } from './smartclickhouse.classes.smartclickhouse';
|
||||
|
||||
export class TimeDataTable {
|
||||
public static async getTable(smartClickHouseDbRefArg: SmartClickHouseDb, tableNameArg: string) {
|
||||
public static async getTable (smartClickHouseDbRefArg: SmartClickHouseDb, tableNameArg: string) {
|
||||
const newTable = new TimeDataTable(smartClickHouseDbRefArg, tableNameArg);
|
||||
|
||||
// create table in clickhouse
|
||||
smartClickHouseDbRefArg;
|
||||
await smartClickHouseDbRefArg.clickhouseClient.queryPromise(`CREATE TABLE IF NOT EXISTS ${newTable.tableName} (
|
||||
timestamp DateTime64(3, 'Europe/Berlin'),
|
||||
message String
|
||||
) ENGINE=MergeTree() ORDER BY timestamp`);
|
||||
return newTable;
|
||||
}
|
||||
|
||||
// INSTANCE
|
||||
public smartClickHouseDbRef: SmartClickHouseDb;
|
||||
public tableName: string;
|
||||
|
||||
constructor(smartClickHouseDbRefArg: SmartClickHouseDb,tableNameArg: string) {
|
||||
|
||||
constructor(smartClickHouseDbRefArg: SmartClickHouseDb, tableNameArg: string) {
|
||||
this.smartClickHouseDbRef = smartClickHouseDbRefArg;
|
||||
this.tableName = tableNameArg;
|
||||
}
|
||||
|
||||
/**
|
||||
* stores a json and tries to map it to the nested syntax
|
||||
*/
|
||||
public async storeJson () {}
|
||||
}
|
Reference in New Issue
Block a user