@@ -17,7 +17,7 @@ export interface ClickHouseLibArgs {
17
17
username : string ;
18
18
password : string ;
19
19
indexType ?: string ;
20
- indexParam ?: Record < string , number > ;
20
+ indexParam ?: string | Record < string , number > ;
21
21
indexQueryParams ?: Record < string , string > ;
22
22
columnMap ?: ColumnMap ;
23
23
database ?: string ;
@@ -55,7 +55,7 @@ export class ClickHouseStore extends VectorStore {
55
55
56
56
private indexType : string ;
57
57
58
- private indexParam : Record < string , number > ;
58
+ private indexParam : string | Record < string , number > ;
59
59
60
60
private indexQueryParams : Record < string , string > ;
61
61
@@ -225,11 +225,16 @@ export class ClickHouseStore extends VectorStore {
225
225
private async initialize ( dimension ?: number ) : Promise < void > {
226
226
const dim = dimension ?? ( await this . embeddings . embedQuery ( "test" ) ) . length ;
227
227
228
- const indexParamStr = this . indexParam
229
- ? Object . entries ( this . indexParam )
228
+ let indexParamStr = "" ;
229
+ if ( this . indexParam ) {
230
+ if ( typeof this . indexParam === "string" ) {
231
+ indexParamStr = this . indexParam ;
232
+ } else {
233
+ indexParamStr = Object . entries ( this . indexParam )
230
234
. map ( ( [ key , value ] ) => `'${ key } ', ${ value } ` )
231
- . join ( ", " )
232
- : "" ;
235
+ . join ( ", " ) ;
236
+ }
237
+ }
233
238
234
239
const query = `
235
240
CREATE TABLE IF NOT EXISTS ${ this . database } .${ this . table } (
0 commit comments