Skip to content

Java: SQLite Memory Connector throws an error when opening existing SK database #2499

@dlwildschut

Description

@dlwildschut

Describe the bug
When opening a SQLite database that has already been used for SK once, I get an error: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (index SKMemoryIndex already exists)

To Reproduce
Steps to reproduce the behavior:

  1. Connect to a file-based SQLite db with SQLiteMemoryStore connectAsync, use it to store documents etc.
  2. After closing the database, connect to the same database again, which fails with an exception.

Expected behavior
I expect the database to be reopened and to be able to access my stored embedded documents.

Screenshots
If applicable, add screenshots to help explain your problem.

Platform

  • OS: Windows
  • IDE: IntelliJ
  • Language: Java
  • Source: java-0.2.8-alpha

Additional context
The error is caused by a missing IF NOT EXISTS for the index creation in com.microsoft.semantickernel.connectors.memory.sqlite.Database.createTableAsync(...)

Metadata

Metadata

Assignees

Labels

ai connectorAnything related to AI connectorsbugSomething isn't workingjavaIssue or PR regarding Java codememory connector

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions