feat(insights): fix DBSCAN, Persian embeddings crash, D3 physics layouts, and D3 node not found runtime error
This commit is contained in:
@@ -8,10 +8,10 @@ import prisma from '@/lib/prisma'
|
||||
export async function upsertNoteEmbedding(noteId: string, embedding: number[]): Promise<void> {
|
||||
const vecStr = `[${embedding.join(',')}]`
|
||||
await prisma.$executeRawUnsafe(
|
||||
`INSERT INTO "NoteEmbedding" ("id", "noteId", "embedding", "createdAt", "updatedAt")
|
||||
VALUES (gen_random_uuid(), $1, $2::vector, now(), now())
|
||||
`INSERT INTO "NoteEmbedding" ("id", "noteId", "embedding", "createdAt")
|
||||
VALUES (gen_random_uuid(), $1, $2::vector, now())
|
||||
ON CONFLICT ("noteId")
|
||||
DO UPDATE SET "embedding" = EXCLUDED."embedding", "updatedAt" = now()`,
|
||||
DO UPDATE SET "embedding" = EXCLUDED."embedding"`,
|
||||
noteId,
|
||||
vecStr
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user