Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
73529b353c | |||
88d1b6596f | |||
6ef8812a79 | |||
3034ef2edd |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartclickhouse",
|
"name": "@pushrocks/smartclickhouse",
|
||||||
"version": "1.0.8",
|
"version": "1.0.10",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@pushrocks/smartclickhouse",
|
"name": "@pushrocks/smartclickhouse",
|
||||||
"version": "1.0.8",
|
"version": "1.0.10",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@depyronick/clickhouse-client": "^1.0.12",
|
"@depyronick/clickhouse-client": "^1.0.12",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartclickhouse",
|
"name": "@pushrocks/smartclickhouse",
|
||||||
"version": "1.0.8",
|
"version": "1.0.10",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "an odm for talking to clickhouse",
|
"description": "an odm for talking to clickhouse",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -32,10 +32,18 @@ export class TimeDataTable {
|
|||||||
|
|
||||||
// create table in clickhouse
|
// create table in clickhouse
|
||||||
await smartClickHouseDbRefArg.clickhouseClient
|
await smartClickHouseDbRefArg.clickhouseClient
|
||||||
.queryPromise(`CREATE TABLE IF NOT EXISTS ${newTable.tableName} (
|
.queryPromise(`
|
||||||
timestamp DateTime64(3, 'Europe/Berlin'),
|
CREATE TABLE IF NOT EXISTS ${newTable.tableName} (
|
||||||
message String
|
timestamp DateTime64(3, 'Europe/Berlin'),
|
||||||
) ENGINE=MergeTree() ORDER BY timestamp`);
|
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();
|
await newTable.updateColumns();
|
||||||
console.log(`=======================`)
|
console.log(`=======================`)
|
||||||
@ -60,7 +68,6 @@ export class TimeDataTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public columns: IColumnInfo[] = [];
|
public columns: IColumnInfo[] = [];
|
||||||
public seenPaths: { pathName: string; type: TClickhouseColumnDataType }[] = [];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* updates the columns
|
* updates the columns
|
||||||
|
Reference in New Issue
Block a user