@voltagent/libsql 1.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -333,7 +333,13 @@ var LibSQLMemoryCore = class {
333
333
  await this.executeWithRetry(async () => {
334
334
  await this.client.execute({
335
335
  sql: `INSERT INTO ${messagesTable} (conversation_id, message_id, user_id, role, parts, metadata, format_version, created_at)
336
- VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,
336
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)
337
+ ON CONFLICT(conversation_id, message_id) DO UPDATE SET
338
+ user_id = excluded.user_id,
339
+ role = excluded.role,
340
+ parts = excluded.parts,
341
+ metadata = excluded.metadata,
342
+ format_version = excluded.format_version`,
337
343
  args: [
338
344
  conversationId,
339
345
  message.id,
@@ -359,7 +365,13 @@ var LibSQLMemoryCore = class {
359
365
  await this.client.batch(
360
366
  messages.map((message) => ({
361
367
  sql: `INSERT INTO ${messagesTable} (conversation_id, message_id, user_id, role, parts, metadata, format_version, created_at)
362
- VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,
368
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)
369
+ ON CONFLICT(conversation_id, message_id) DO UPDATE SET
370
+ user_id = excluded.user_id,
371
+ role = excluded.role,
372
+ parts = excluded.parts,
373
+ metadata = excluded.metadata,
374
+ format_version = excluded.format_version`,
363
375
  args: [
364
376
  conversationId,
365
377
  message.id,