clickhouse-ts
Advanced tools
Comparing version 1.3.5 to 1.3.6
@@ -49,3 +49,3 @@ "use strict"; | ||
else if (__classPrivateFieldGet(this, _RedisCacheManager_options, "f").chunkResolveType === 'events') { | ||
this.emit('chunk', chunkNamespace, rows); | ||
this.emit('chunk', chunkNamespace, table, rows); | ||
} | ||
@@ -52,0 +52,0 @@ else { |
@@ -28,3 +28,3 @@ import { ClickhouseNamespace } from './interface'; | ||
useCaching(type: 'redis', client: Redis): void; | ||
onChunk(onChunkCb: (chunkId: string, rows: ClickhouseNamespace.InsertRows) => void): void; | ||
onChunk(onChunkCb: (chunkId: string, table: string, rows: ClickhouseNamespace.InsertRows) => void): void; | ||
cache(table: string, rows: ClickhouseNamespace.InsertRows): Promise<{ | ||
@@ -31,0 +31,0 @@ chunk: string; |
@@ -81,3 +81,3 @@ "use strict"; | ||
__classPrivateFieldSet(this, _Clickhouse_redisClient, client, "f"); | ||
__classPrivateFieldGet(this, _Clickhouse_cacheManager, "f").on('chunk', (chunkId, rows) => __classPrivateFieldGet(this, _Clickhouse_onChunkCb, "f").forEach(cb => cb(chunkId, rows))); | ||
__classPrivateFieldGet(this, _Clickhouse_cacheManager, "f").on('chunk', (chunkId, table, rows) => __classPrivateFieldGet(this, _Clickhouse_onChunkCb, "f").forEach(cb => cb(chunkId, table, rows))); | ||
} | ||
@@ -84,0 +84,0 @@ onChunk(onChunkCb) { |
@@ -12,3 +12,3 @@ { | ||
], | ||
"version": "1.3.5", | ||
"version": "1.3.6", | ||
"license": "MIT", | ||
@@ -15,0 +15,0 @@ "description": "Clickhouse client on TypeScript using nodejs ot redis caching queries", |
@@ -57,3 +57,3 @@ # clickhouse-ts | ||
clickhouseInstance.onChunk(rows => { | ||
clickhouseInstance.onChunk((chunkId, table, rows) => { | ||
// do want you want | ||
@@ -60,0 +60,0 @@ }) |
@@ -55,3 +55,3 @@ import dayjs from "dayjs"; | ||
} else if (this.#options.chunkResolveType === 'events') { | ||
this.emit('chunk', chunkNamespace, rows) | ||
this.emit('chunk', chunkNamespace, table, rows) | ||
} else { | ||
@@ -58,0 +58,0 @@ throw new Error('resolveType is not correct!') |
@@ -14,3 +14,3 @@ import { ClickhouseHttpClient } from '../httpClient/ClickhouseHttpClient' | ||
readonly #cacheManager?: RedisCacheManager | ||
#onChunkCb: ((chunkId: string, rows: ClickhouseNamespace.InsertRows) => void)[] | ||
#onChunkCb: ((chunkId: string, table: string, rows: ClickhouseNamespace.InsertRows) => void)[] | ||
#redisClient?: Redis | ||
@@ -88,6 +88,12 @@ #isFirstInsert: boolean | ||
this.#cacheManager.on('chunk', (chunkId, rows) => this.#onChunkCb.forEach(cb => cb(chunkId, rows))) | ||
this.#cacheManager.on('chunk', ( | ||
chunkId: string, | ||
table: string, | ||
rows: Record<string, any>[] | ||
) => this.#onChunkCb.forEach(cb => cb(chunkId, table, rows))) | ||
} | ||
public onChunk (onChunkCb: (chunkId: string, rows: ClickhouseNamespace.InsertRows) => void) { | ||
public onChunk ( | ||
onChunkCb: (chunkId: string, table: string, rows: ClickhouseNamespace.InsertRows) => void | ||
) { | ||
this.#onChunkCb.push(onChunkCb) | ||
@@ -94,0 +100,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58562
1095