feat: extension, triggers, functions, comments, parameters management in sql-tools (#17269)

feat: sql-tools extension, triggers, functions, comments, parameters
This commit is contained in:
Jason Rasmussen 2025-04-07 15:12:12 -04:00 committed by GitHub
parent 51c2c60231
commit e7a5b96ed0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
170 changed files with 5205 additions and 2295 deletions

View file

@ -1,7 +1,14 @@
import { AssetFaceTable } from 'src/schema/tables/asset-face.table';
import { Column, ColumnIndex, ForeignKeyColumn, Table } from 'src/sql-tools';
import { Column, ForeignKeyColumn, Index, Table } from 'src/sql-tools';
@Table({ name: 'face_search', primaryConstraintName: 'face_search_pkey' })
@Index({
name: 'face_index',
using: 'hnsw',
expression: `embedding vector_cosine_ops`,
with: 'ef_construction = 300, m = 16',
synchronize: false,
})
export class FaceSearchTable {
@ForeignKeyColumn(() => AssetFaceTable, {
onDelete: 'CASCADE',
@ -10,7 +17,6 @@ export class FaceSearchTable {
})
faceId!: string;
@ColumnIndex({ name: 'face_index', synchronize: false })
@Column({ type: 'vector', array: true, length: 512, synchronize: false })
@Column({ type: 'vector', length: 512, synchronize: false })
embedding!: string;
}