8 Commits

Author SHA1 Message Date
0139634902 1.0.12 2022-03-14 13:54:10 +01:00
100cba8d74 fix(core): update 2022-03-14 13:54:09 +01:00
2af84de938 1.0.11 2022-03-14 13:52:42 +01:00
f5ba97aa3d fix(core): update 2022-03-14 13:52:42 +01:00
73529b353c 1.0.10 2022-03-08 18:55:00 +01:00
88d1b6596f fix(TimDataTable): cleanup 2022-03-08 18:55:00 +01:00
6ef8812a79 1.0.9 2022-03-08 18:54:10 +01:00
3034ef2edd fix(TTL): tables now have a default TTL for data of 1 MONTH 2022-03-08 18:54:10 +01:00
3 changed files with 22 additions and 16 deletions

18
package-lock.json generated
View File

@ -1,16 +1,16 @@
{
"name": "@pushrocks/smartclickhouse",
"version": "1.0.8",
"version": "1.0.12",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@pushrocks/smartclickhouse",
"version": "1.0.8",
"version": "1.0.12",
"license": "MIT",
"dependencies": {
"@depyronick/clickhouse-client": "^1.0.12",
"@pushrocks/smartobject": "^1.0.9"
"@pushrocks/smartobject": "^1.0.10"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.25",
@ -2635,9 +2635,9 @@
}
},
"node_modules/@pushrocks/smartobject": {
"version": "1.0.9",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartobject/-/smartobject-1.0.9.tgz",
"integrity": "sha512-74IlcVWhhEOsG7X65H4DmYP1o8HejZMWj5uATCk99A+XjZMi8UJu8H7EsgT++JJKkwLz2BKc9323BfNk1B79WA==",
"version": "1.0.10",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartobject/-/smartobject-1.0.10.tgz",
"integrity": "sha512-Tfhvy/XoYQ0e4Sl/ztvqJh+lxR9+zixHlnMPstYW05ZbRTZzC6lf1EZLcsmjiALkz6IDFNEwrMrwODlJIpjj+A==",
"license": "MIT",
"dependencies": {
"fast-deep-equal": "^3.1.3",
@ -17723,9 +17723,9 @@
}
},
"@pushrocks/smartobject": {
"version": "1.0.9",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartobject/-/smartobject-1.0.9.tgz",
"integrity": "sha512-74IlcVWhhEOsG7X65H4DmYP1o8HejZMWj5uATCk99A+XjZMi8UJu8H7EsgT++JJKkwLz2BKc9323BfNk1B79WA==",
"version": "1.0.10",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartobject/-/smartobject-1.0.10.tgz",
"integrity": "sha512-Tfhvy/XoYQ0e4Sl/ztvqJh+lxR9+zixHlnMPstYW05ZbRTZzC6lf1EZLcsmjiALkz6IDFNEwrMrwODlJIpjj+A==",
"requires": {
"fast-deep-equal": "^3.1.3",
"minimatch": "^5.0.1"

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartclickhouse",
"version": "1.0.8",
"version": "1.0.12",
"private": false,
"description": "an odm for talking to clickhouse",
"main": "dist_ts/index.js",
@ -24,7 +24,7 @@
},
"dependencies": {
"@depyronick/clickhouse-client": "^1.0.12",
"@pushrocks/smartobject": "^1.0.9"
"@pushrocks/smartobject": "^1.0.10"
},
"browserslist": [
"last 1 chrome versions"

View File

@ -32,11 +32,18 @@ export class TimeDataTable {
// create table in clickhouse
await smartClickHouseDbRefArg.clickhouseClient
.queryPromise(`CREATE TABLE IF NOT EXISTS ${newTable.tableName} (
.queryPromise(`
CREATE TABLE IF NOT EXISTS ${newTable.tableName} (
timestamp DateTime64(3, 'Europe/Berlin'),
message String
) ENGINE=MergeTree() ORDER BY timestamp`);
// lets adjust the TTL
await smartClickHouseDbRefArg.clickhouseClient
.queryPromise(`
ALTER TABLE ${newTable.tableName} MODIFY TTL toDateTime(timestamp) + INTERVAL 1 MONTH
`);
await newTable.updateColumns();
console.log(`=======================`)
console.log(
@ -60,7 +67,6 @@ export class TimeDataTable {
}
public columns: IColumnInfo[] = [];
public seenPaths: { pathName: string; type: TClickhouseColumnDataType }[] = [];
/**
* updates the columns