From cb41edfde6b340b71ced217c1e91fe660f96a05f Mon Sep 17 00:00:00 2001 From: Mitchell Adair Date: Wed, 18 Dec 2024 15:27:55 -0500 Subject: [PATCH] simplify vector class --- .../src/singlestore-core/columns/vector.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drizzle-orm/src/singlestore-core/columns/vector.ts b/drizzle-orm/src/singlestore-core/columns/vector.ts index c8f05a63f..7bfc950de 100644 --- a/drizzle-orm/src/singlestore-core/columns/vector.ts +++ b/drizzle-orm/src/singlestore-core/columns/vector.ts @@ -29,21 +29,20 @@ export class SingleStoreVectorBuilder( table: AnySingleStoreTable<{ name: TTableName }>, ): SingleStoreVector> { - return new SingleStoreVector(table, this.config as ColumnBuilderRuntimeConfig); + return new SingleStoreVector>( + table, + this.config as ColumnBuilderRuntimeConfig, + ); } } -export class SingleStoreVector> extends SingleStoreColumn { +export class SingleStoreVector> + extends SingleStoreColumn +{ static override readonly [entityKind]: string = 'SingleStoreVector'; - readonly dimensions: number; - readonly elementType: ElementType | undefined; - - constructor(table: AnySingleStoreTable<{ name: T['tableName'] }>, config: SingleStoreVectorBuilder['config']) { - super(table, config); - this.dimensions = config.dimensions; - this.elementType = config.elementType; - } + dimensions: number = this.config.dimensions; + elementType: ElementType | undefined = this.config.elementType; getSQLType(): string { return `vector(${this.dimensions}, ${this.elementType || 'F32'})`;