Skip to content
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

PARTITION KEY support #122

Merged
merged 24 commits into from
Nov 20, 2024
Merged

PARTITION KEY support #122

merged 24 commits into from
Nov 20, 2024

Conversation

asg017
Copy link
Owner

@asg017 asg017 commented Oct 15, 2024

References #29

Work in progress, needs more bug fixing, docs, and tests.

create virtual table vec_chunks using vec0(
  chunk_id integer primary key,
  user_id integer partition key, --> Partition key!
  contents_embedding float[1],
);

select chunk_id, user_id, distance
from vec_chunks
where contents_embedding match '[19]'
  and user_id = 123
  and k = 5;

/*
┌──────────┬─────────┬──────────┐
│ chunk_id │ user_id │ distance │
├──────────┼─────────┼──────────┤
│ 20       │ 123     │ 1.0      │
│          │         │          │
├──────────┼─────────┼──────────┤
│ 17       │ 123     │ 2.0      │
│          │         │          │
├──────────┼─────────┼──────────┤
│ 15       │ 123     │ 4.0      │
│          │         │          │
├──────────┼─────────┼──────────┤
│ 5        │ 123     │ 14.0     │
├──────────┼─────────┼──────────┤
│ 4        │ 123     │ 15.0     │
│          │         │          │
└──────────┴─────────┴──────────┘
*/

This was referenced Oct 15, 2024
@asg017 asg017 marked this pull request as ready for review November 20, 2024 05:47
@asg017 asg017 changed the title DRAFT: PARTITION KEY support PARTITION KEY support Nov 20, 2024
@asg017
Copy link
Owner Author

asg017 commented Nov 20, 2024

yolo

@asg017 asg017 merged commit 6658624 into main Nov 20, 2024
17 checks passed
zkhin added a commit to zkhin/sqlite-vec that referenced this pull request Jan 20, 2025
* initial pass at PARTITION KEY support.

* unit tests

* gha this PR branch

* fixup tests

* doc internal

* fix tests, KNN/rowids in

* define SQLITE_INDEX_CONSTRAINT_OFFSET

* whoops

* update tests, syrupy, use uv

* un ignore pyproject.toml

* dot

* tests/

* type error?

* win: .exe, update error name

* try fix macos python, paren around expr?

* win bash?

* dbg :(

* explicit error

* op

* dbg win

* win ./tests/.venv/Scripts/python.exe

* block UPDATEs on partition key values for now
zkhin added a commit to zkhin/sqlite-vec that referenced this pull request Jan 23, 2025
* initial pass at PARTITION KEY support.

* unit tests

* gha this PR branch

* fixup tests

* doc internal

* fix tests, KNN/rowids in

* define SQLITE_INDEX_CONSTRAINT_OFFSET

* whoops

* update tests, syrupy, use uv

* un ignore pyproject.toml

* dot

* tests/

* type error?

* win: .exe, update error name

* try fix macos python, paren around expr?

* win bash?

* dbg :(

* explicit error

* op

* dbg win

* win ./tests/.venv/Scripts/python.exe

* block UPDATEs on partition key values for now
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