Skip to content

Commit 4129858

Browse files
authored
Merge pull request #1 from atasoglu/develop
Release v0.2.0: sqlite-vec-client initial release
2 parents 7e2cf58 + fa8fdfa commit 4129858

39 files changed

+2987
-132
lines changed

.coveragerc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[run]
2+
source = sqlite_vec_client
3+
omit =
4+
*/tests/*
5+
*/test_*.py
6+
*/__pycache__/*
7+
*/site-packages/*
8+
9+
[report]
10+
exclude_lines =
11+
pragma: no cover
12+
def __repr__
13+
raise AssertionError
14+
raise NotImplementedError
15+
if __name__ == .__main__.:
16+
if TYPE_CHECKING:
17+
@abstractmethod

.github/workflows/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# GitHub Actions Workflows
2+
3+
This directory contains CI/CD workflows for the sqlite-vec-client project.
4+
5+
## Workflows
6+
7+
### test.yml - Continuous Integration
8+
Runs on every push and pull request to `main` and `develop` branches.
9+
10+
**What it does:**
11+
- Tests across Python 3.9-3.13
12+
- Tests on Ubuntu, Windows, and macOS
13+
- Runs linting (ruff check)
14+
- Runs format checking (ruff format)
15+
- Runs type checking (mypy)
16+
- Runs test suite with coverage report
17+
18+
### publish.yml - PyPI Publishing
19+
Runs automatically when a GitHub release is published.
20+
21+
**What it does:**
22+
- Builds the package
23+
- Publishes to PyPI using the PYPI_API_TOKEN secret
24+
25+
## Setup Requirements
26+
27+
### For PyPI Publishing
28+
1. Generate a PyPI API token at [pypi.org](https://pypi.org/manage/account/token/)
29+
2. Add `PYPI_API_TOKEN` to GitHub repository secrets
30+
31+
## Badge URL
32+
33+
Add this to your README.md:
34+
35+
```markdown
36+
[![CI](https://github.com/atasoglu/sqlite-vec-client/actions/workflows/test.yml/badge.svg)](https://github.com/atasoglu/sqlite-vec-client/actions/workflows/test.yml)
37+
```

.github/workflows/publish.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.11'
20+
21+
- name: Get version from pyproject.toml
22+
id: get_version
23+
run: |
24+
VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
25+
echo "version=v$VERSION" >> $GITHUB_OUTPUT
26+
27+
- name: Create Release
28+
id: create_release
29+
uses: actions/create-release@v1
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
tag_name: ${{ steps.get_version.outputs.version }}
34+
release_name: Release ${{ steps.get_version.outputs.version }}
35+
body: |
36+
## What's Changed
37+
${{ github.event.head_commit.message }}
38+
39+
**Full Changelog**: https://github.com/${{ github.repository }}/commits/${{ steps.get_version.outputs.version }}
40+
draft: false
41+
prerelease: false
42+
43+
- name: Install build dependencies
44+
run: |
45+
python -m pip install --upgrade pip
46+
pip install build twine
47+
48+
- name: Build package
49+
run: python -m build
50+
51+
- name: Publish to PyPI
52+
env:
53+
TWINE_USERNAME: __token__
54+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
55+
run: twine upload dist/*

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -e .
28+
pip install -r requirements-dev.txt
29+
30+
- name: Lint with ruff
31+
run: ruff check .
32+
33+
- name: Format check with ruff
34+
run: ruff format --check .
35+
36+
- name: Type check with mypy
37+
run: mypy sqlite_vec_client/
38+
39+
- name: Test with pytest
40+
run: pytest --cov=sqlite_vec_client --cov-report=term

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ cython_debug/
182182
.abstra/
183183

184184
# Visual Studio Code
185-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
185+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186186
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
187+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188188
# you could uncomment the following to ignore the entire vscode folder
189189
# .vscode/
190190

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- id: check-merge-conflict
10+
- id: check-toml
11+
12+
- repo: https://github.com/astral-sh/ruff-pre-commit
13+
rev: v0.3.0
14+
hooks:
15+
- id: ruff
16+
args: [--fix]
17+
- id: ruff-format
18+
19+
- repo: https://github.com/pre-commit/mirrors-mypy
20+
rev: v1.8.0
21+
hooks:
22+
- id: mypy
23+
args: [--ignore-missing-imports]

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"python.testing.pytestArgs": [
3+
"tests"
4+
],
5+
"python.testing.unittestEnabled": false,
6+
"python.testing.pytestEnabled": true
7+
}

CHANGELOG.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.2.0] - 2025-01-27
11+
12+
### Added
13+
- `update_many()` - Bulk update multiple records in a single transaction
14+
- `get_all()` - Memory-efficient generator for iterating over all records
15+
- `transaction()` - Context manager for atomic multi-operation transactions
16+
- Comprehensive tests for bulk operations (91%+ coverage)
17+
- Updated batch_operations.py example with new features
18+
- CONTRIBUTING.md with contribution guidelines
19+
- CHANGELOG.md for tracking changes
20+
- Python logging module integration with configurable log levels
21+
- Complete CI/CD pipeline with GitHub Actions
22+
- Pre-commit hooks and code quality tools (ruff, mypy)
23+
24+
### Security
25+
- SQL injection prevention with table name validation
26+
- Input validation for all parameters
27+
- Custom exception classes for better error handling
28+
29+
## [0.1.0] - 2025-01-XX
30+
31+
### Added
32+
- Initial release of sqlite-vec-client
33+
- `SQLiteVecClient` class for CRUD and similarity search operations
34+
- Support for text, metadata (JSON), and float32 embeddings
35+
- Automatic synchronization between base table and vec0 index via triggers
36+
- Context manager support for automatic connection cleanup
37+
- Comprehensive test suite with 91%+ coverage
38+
- Security features: SQL injection prevention, input validation
39+
- Custom exception classes for better error handling
40+
- Type hints and dataclasses for typed results
41+
- Examples demonstrating various use cases
42+
- Development tooling: ruff, mypy, pre-commit hooks
43+
44+
### Core Features
45+
- `create_table()` - Initialize schema with configurable dimensions and distance metrics
46+
- `add()` - Insert texts with embeddings
47+
- `update()` - Update existing records
48+
- `delete()` - Remove records by rowid
49+
- `get()` - Fetch single record by rowid
50+
- `get_many()` - Fetch multiple records
51+
- `get_by_text()` - Find records by exact text match
52+
- `get_by_metadata()` - Find records by metadata JSON match
53+
- `list_all()` - List all records with pagination
54+
- `similarity_search()` - Vector similarity search with configurable top_k
55+
- `count()` - Get total record count
56+
- `clear()` - Remove all records
57+
- `drop_table()` - Delete table and index
58+
59+
### Distance Metrics
60+
- Cosine similarity (`cosine`)
61+
- L2 distance (`l2`)
62+
- L1 distance (`l1`)
63+
64+
### Documentation
65+
- Comprehensive README with quick start guide
66+
- TESTING.md with testing documentation
67+
- SECURITY_IMPROVEMENTS.md documenting security enhancements
68+
- Multiple examples in `examples/` directory
69+
70+
### Dependencies
71+
- Python 3.9+
72+
- SQLite 3.41+
73+
- sqlite-vec 0.1.6+
74+
75+
## [0.0.1] - 2025-01-XX (Pre-release)
76+
77+
### Added
78+
- Initial project structure
79+
- Basic SQLiteVecClient implementation
80+
- Proof of concept
81+
82+
---
83+
84+
## Version History
85+
86+
- **0.2.0** - Bulk operations, logging, security improvements, CI/CD
87+
- **0.1.0** - First stable release with comprehensive features and testing
88+
- **0.0.1** - Initial development version
89+
90+
## Upgrade Guide
91+
92+
### From 0.1.x to 0.2.0
93+
94+
No breaking changes. New features:
95+
- Use `update_many()` for bulk updates
96+
- Use `get_all()` for memory-efficient iteration
97+
- Use `transaction()` context manager for atomic operations
98+
- Configure logging via environment variable or programmatically
99+
100+
### From 0.0.x to 0.1.0
101+
102+
No breaking changes. This is the first stable release.
103+
104+
---
105+
106+
## Contributing
107+
108+
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on contributing to this project.
109+
110+
## Links
111+
112+
- [GitHub Repository](https://github.com/atasoglu/sqlite-vec-client)
113+
- [PyPI Package](https://pypi.org/project/sqlite-vec-client/)
114+
- [Issue Tracker](https://github.com/atasoglu/sqlite-vec-client/issues)

0 commit comments

Comments
 (0)