Skip to content

Support for multiple indices #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Support for multiple indices #2

wants to merge 11 commits into from

Conversation

pqnet
Copy link
Owner

@pqnet pqnet commented Mar 17, 2025

No description provided.

@pqnet pqnet requested a review from Copilot March 31, 2025 15:08
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for multiple indices and updates various modules and tests accordingly. Key changes include updates to migration logic for a new multi-index schema, integration of a new DatabaseService for document and index operations, and corresponding API and documentation updates.

Reviewed Changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/database/migrations/001-initialize-schema.test.ts Tests for schema initialization, migration from old schema handling.
test/database-service.test.ts New tests for index operations and document embedding.
test/api-integration.test.js Integration tests covering API endpoints for indices and documents.
test/api-compatibility.test.ts Compatibility tests for document formats and index queries.
server/utils/getDb.ts Updated to run migrations and load the sqlite-vec extension.
server/utils/getDatabaseService.ts New utility to create and memoize the DatabaseService instance.
server/utils/DatabaseService.ts Adds methods for document insertion, index management, and search.
server/database/schema.ts New migration framework for managing schema changes.
server/database/migrations/001-initialize-schema/index.ts Migration logic to initialize or migrate to the multi-index schema.
server/api/indices/index.ts API endpoint for listing and creating indices.
server/api/documents/index.post.ts API endpoint for inserting documents with dynamic index processing.
server/api/documents/index.get.ts API endpoint for searching documents by vector embedding.
nitro.config.ts Configuration updates to support the better-sqlite3 connector.
README.md Documentation updates explaining multi-index support and usage.
Files not reviewed (2)
  • .editorconfig: Language not supported
  • package.json: Language not supported
Comments suppressed due to low confidence (2)

server/api/documents/index.post.ts:1

  • The updated code uses dbService via getDatabaseService but the file does not import it. Please add: import getDatabaseService from '../../server/utils/getDatabaseService'; at the top of the file.
import { Primitive } from "db0";

server/api/documents/index.get.ts:1

  • The handler references getDatabaseService without an import. Add an import statement for getDatabaseService at the top of the file, for example: import getDatabaseService from '../../server/utils/getDatabaseService';.
import { Primitive } from "db0";

@@ -0,0 +1,97 @@
export default defineLazyEventHandler(async () => {
Copy link
Preview

Copilot AI Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that getDatabaseService is used but not imported. Consider adding an import statement such as: import getDatabaseService from '../../server/utils/getDatabaseService'; at the top of the file.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant