ormkit 0.1.4__tar.gz
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.
- ormkit-0.1.4/.github/workflows/ci.yml +79 -0
- ormkit-0.1.4/.github/workflows/docs.yml +59 -0
- ormkit-0.1.4/.github/workflows/publish.yml +128 -0
- ormkit-0.1.4/.github/workflows/release.yml +1 -0
- ormkit-0.1.4/.gitignore +49 -0
- ormkit-0.1.4/Cargo.lock +1211 -0
- ormkit-0.1.4/Cargo.toml +66 -0
- ormkit-0.1.4/PKG-INFO +521 -0
- ormkit-0.1.4/README.md +501 -0
- ormkit-0.1.4/benchmarks/RESULTS.md +13 -0
- ormkit-0.1.4/benchmarks/__init__.py +0 -0
- ormkit-0.1.4/benchmarks/bench_json.py +760 -0
- ormkit-0.1.4/benchmarks/bench_m2m.py +290 -0
- ormkit-0.1.4/benchmarks/bench_soft_delete.py +226 -0
- ormkit-0.1.4/benchmarks/bench_sqlite.py +221 -0
- ormkit-0.1.4/benchmarks/bench_upsert.py +203 -0
- ormkit-0.1.4/benchmarks/breakdown.py +104 -0
- ormkit-0.1.4/benchmarks/compare_postgres.py +828 -0
- ormkit-0.1.4/benchmarks/compare_raw.py +138 -0
- ormkit-0.1.4/benchmarks/conftest.py +33 -0
- ormkit-0.1.4/benchmarks/docker-compose.yml +18 -0
- ormkit-0.1.4/benchmarks/isolated/__init__.py +1 -0
- ormkit-0.1.4/benchmarks/isolated/aiosqlite_bench.py +76 -0
- ormkit-0.1.4/benchmarks/isolated/asyncpg_bench.py +138 -0
- ormkit-0.1.4/benchmarks/isolated/databases_bench.py +46 -0
- ormkit-0.1.4/benchmarks/isolated/helpers.py +45 -0
- ormkit-0.1.4/benchmarks/isolated/ormar_bench.py +103 -0
- ormkit-0.1.4/benchmarks/isolated/ormkit_postgres.py +138 -0
- ormkit-0.1.4/benchmarks/isolated/ormkit_sqlite.py +74 -0
- ormkit-0.1.4/benchmarks/isolated/piccolo_bench.py +64 -0
- ormkit-0.1.4/benchmarks/isolated/seed_postgres.py +47 -0
- ormkit-0.1.4/benchmarks/isolated/sqlalchemy_bench.py +63 -0
- ormkit-0.1.4/benchmarks/isolated/tortoise_bench.py +61 -0
- ormkit-0.1.4/benchmarks/micro_bench.py +176 -0
- ormkit-0.1.4/benchmarks/results.json +128 -0
- ormkit-0.1.4/benchmarks/run_all.py +359 -0
- ormkit-0.1.4/benchmarks/runner.py +710 -0
- ormkit-0.1.4/docs/api/engine.md +267 -0
- ormkit-0.1.4/docs/api/index.md +69 -0
- ormkit-0.1.4/docs/api/models.md +402 -0
- ormkit-0.1.4/docs/api/query.md +477 -0
- ormkit-0.1.4/docs/api/session.md +407 -0
- ormkit-0.1.4/docs/contributing/architecture.md +368 -0
- ormkit-0.1.4/docs/contributing/development.md +205 -0
- ormkit-0.1.4/docs/contributing/index.md +25 -0
- ormkit-0.1.4/docs/getting-started/first-app.md +284 -0
- ormkit-0.1.4/docs/getting-started/index.md +50 -0
- ormkit-0.1.4/docs/getting-started/installation.md +125 -0
- ormkit-0.1.4/docs/getting-started/quickstart.md +246 -0
- ormkit-0.1.4/docs/guide/index.md +90 -0
- ormkit-0.1.4/docs/guide/models.md +219 -0
- ormkit-0.1.4/docs/guide/queries.md +433 -0
- ormkit-0.1.4/docs/guide/raw-sql.md +284 -0
- ormkit-0.1.4/docs/guide/relationships.md +290 -0
- ormkit-0.1.4/docs/guide/transactions.md +214 -0
- ormkit-0.1.4/docs/includes/abbreviations.md +8 -0
- ormkit-0.1.4/docs/index.md +206 -0
- ormkit-0.1.4/docs/performance/benchmarks.md +184 -0
- ormkit-0.1.4/docs/performance/index.md +86 -0
- ormkit-0.1.4/docs/performance/optimization.md +302 -0
- ormkit-0.1.4/docs/stylesheets/extra.css +174 -0
- ormkit-0.1.4/mkdocs.yml +148 -0
- ormkit-0.1.4/pyproject.toml +111 -0
- ormkit-0.1.4/python/ormkit/__init__.py +79 -0
- ormkit-0.1.4/python/ormkit/_foreignkey.pyi +76 -0
- ormkit-0.1.4/python/ormkit/base.py +399 -0
- ormkit-0.1.4/python/ormkit/cli/__init__.py +700 -0
- ormkit-0.1.4/python/ormkit/fields.py +227 -0
- ormkit-0.1.4/python/ormkit/migrations/__init__.py +58 -0
- ormkit-0.1.4/python/ormkit/migrations/autogen.py +566 -0
- ormkit-0.1.4/python/ormkit/migrations/config.py +330 -0
- ormkit-0.1.4/python/ormkit/migrations/operations.py +522 -0
- ormkit-0.1.4/python/ormkit/migrations/runner.py +427 -0
- ormkit-0.1.4/python/ormkit/migrations/script.py +568 -0
- ormkit-0.1.4/python/ormkit/mixins.py +93 -0
- ormkit-0.1.4/python/ormkit/py.typed +0 -0
- ormkit-0.1.4/python/ormkit/query.py +460 -0
- ormkit-0.1.4/python/ormkit/relationships.py +394 -0
- ormkit-0.1.4/python/ormkit/session.py +1912 -0
- ormkit-0.1.4/src/error.rs +44 -0
- ormkit-0.1.4/src/executor.rs +451 -0
- ormkit-0.1.4/src/lib.rs +52 -0
- ormkit-0.1.4/src/pg/connection.rs +1105 -0
- ormkit-0.1.4/src/pg/error.rs +88 -0
- ormkit-0.1.4/src/pg/mod.rs +35 -0
- ormkit-0.1.4/src/pg/pool.rs +356 -0
- ormkit-0.1.4/src/pg/protocol.rs +738 -0
- ormkit-0.1.4/src/pg/scram.rs +274 -0
- ormkit-0.1.4/src/pg/statement.rs +297 -0
- ormkit-0.1.4/src/pg/tests.rs +786 -0
- ormkit-0.1.4/src/pg/types.rs +428 -0
- ormkit-0.1.4/src/pool.rs +1158 -0
- ormkit-0.1.4/src/schema.rs +216 -0
- ormkit-0.1.4/src/sqlite/connection.rs +167 -0
- ormkit-0.1.4/src/sqlite/error.rs +60 -0
- ormkit-0.1.4/src/sqlite/mod.rs +20 -0
- ormkit-0.1.4/src/sqlite/pool.rs +187 -0
- ormkit-0.1.4/src/sqlite/tests.rs +99 -0
- ormkit-0.1.4/src/sqlite/types.rs +123 -0
- ormkit-0.1.4/tests/__init__.py +0 -0
- ormkit-0.1.4/tests/conftest.py +33 -0
- ormkit-0.1.4/tests/test_json_fields.py +260 -0
- ormkit-0.1.4/tests/test_m2m.py +404 -0
- ormkit-0.1.4/tests/test_migrations.py +517 -0
- ormkit-0.1.4/tests/test_models.py +110 -0
- ormkit-0.1.4/tests/test_new_features.py +363 -0
- ormkit-0.1.4/tests/test_queries.py +128 -0
- ormkit-0.1.4/tests/test_relationships.py +228 -0
- ormkit-0.1.4/tests/test_session.py +192 -0
- ormkit-0.1.4/tests/test_session_fluent.py +320 -0
- ormkit-0.1.4/tests/test_soft_delete.py +370 -0
- ormkit-0.1.4/tests/test_upsert.py +339 -0
- ormkit-0.1.4/uv.lock +1413 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, master]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ['3.12', '3.13']
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Setup Python ${{ matrix.python-version }}
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install Rust
|
|
25
|
+
uses: dtolnay/rust-toolchain@stable
|
|
26
|
+
|
|
27
|
+
- name: Install uv
|
|
28
|
+
uses: astral-sh/setup-uv@v4
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: uv sync --group dev
|
|
32
|
+
|
|
33
|
+
- name: Build Rust extension
|
|
34
|
+
run: uv run maturin develop --release
|
|
35
|
+
|
|
36
|
+
- name: Run tests
|
|
37
|
+
run: uv run pytest tests/ -v
|
|
38
|
+
|
|
39
|
+
- name: Type check
|
|
40
|
+
run: uvx ty check python/ormkit/ --ignore unresolved-import
|
|
41
|
+
continue-on-error: true
|
|
42
|
+
|
|
43
|
+
lint:
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v4
|
|
47
|
+
|
|
48
|
+
- name: Setup Python
|
|
49
|
+
uses: actions/setup-python@v5
|
|
50
|
+
with:
|
|
51
|
+
python-version: '3.12'
|
|
52
|
+
|
|
53
|
+
- name: Install uv
|
|
54
|
+
uses: astral-sh/setup-uv@v4
|
|
55
|
+
|
|
56
|
+
- name: Install dependencies
|
|
57
|
+
run: uv sync --group dev
|
|
58
|
+
|
|
59
|
+
- name: Lint with ruff
|
|
60
|
+
run: uv run ruff check python/
|
|
61
|
+
|
|
62
|
+
rust:
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
steps:
|
|
65
|
+
- uses: actions/checkout@v4
|
|
66
|
+
|
|
67
|
+
- name: Install Rust
|
|
68
|
+
uses: dtolnay/rust-toolchain@stable
|
|
69
|
+
with:
|
|
70
|
+
components: clippy, rustfmt
|
|
71
|
+
|
|
72
|
+
- name: Check formatting
|
|
73
|
+
run: cargo fmt --all -- --check
|
|
74
|
+
|
|
75
|
+
- name: Clippy
|
|
76
|
+
run: cargo clippy --all-targets -- -D warnings
|
|
77
|
+
|
|
78
|
+
- name: Run Rust tests
|
|
79
|
+
run: cargo test --all
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Deploy Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths:
|
|
8
|
+
- 'docs/**'
|
|
9
|
+
- 'mkdocs.yml'
|
|
10
|
+
- '.github/workflows/docs.yml'
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
pages: write
|
|
16
|
+
id-token: write
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: "pages"
|
|
20
|
+
cancel-in-progress: false
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
build:
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
steps:
|
|
26
|
+
- name: Checkout
|
|
27
|
+
uses: actions/checkout@v4
|
|
28
|
+
|
|
29
|
+
- name: Setup Python
|
|
30
|
+
uses: actions/setup-python@v5
|
|
31
|
+
with:
|
|
32
|
+
python-version: '3.12'
|
|
33
|
+
|
|
34
|
+
- name: Install uv
|
|
35
|
+
uses: astral-sh/setup-uv@v4
|
|
36
|
+
with:
|
|
37
|
+
version: "latest"
|
|
38
|
+
|
|
39
|
+
- name: Install dependencies
|
|
40
|
+
run: uv sync --group docs
|
|
41
|
+
|
|
42
|
+
- name: Build documentation
|
|
43
|
+
run: uv run mkdocs build --strict
|
|
44
|
+
|
|
45
|
+
- name: Upload artifact
|
|
46
|
+
uses: actions/upload-pages-artifact@v3
|
|
47
|
+
with:
|
|
48
|
+
path: ./site
|
|
49
|
+
|
|
50
|
+
deploy:
|
|
51
|
+
environment:
|
|
52
|
+
name: github-pages
|
|
53
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
needs: build
|
|
56
|
+
steps:
|
|
57
|
+
- name: Deploy to GitHub Pages
|
|
58
|
+
id: deployment
|
|
59
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
name: Release and Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
paths:
|
|
7
|
+
- 'pyproject.toml'
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: write
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
check-version:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
outputs:
|
|
18
|
+
version: ${{ steps.current.outputs.version }}
|
|
19
|
+
exists: ${{ steps.check.outputs.exists }}
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
|
|
25
|
+
- name: Get current version
|
|
26
|
+
id: current
|
|
27
|
+
run: |
|
|
28
|
+
VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
|
|
29
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
30
|
+
|
|
31
|
+
- name: Check if tag exists
|
|
32
|
+
id: check
|
|
33
|
+
run: |
|
|
34
|
+
if git rev-parse "v${{ steps.current.outputs.version }}" >/dev/null 2>&1; then
|
|
35
|
+
echo "exists=true" >> $GITHUB_OUTPUT
|
|
36
|
+
else
|
|
37
|
+
echo "exists=false" >> $GITHUB_OUTPUT
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
build:
|
|
41
|
+
needs: check-version
|
|
42
|
+
if: needs.check-version.outputs.exists == 'false'
|
|
43
|
+
name: Build wheels on ${{ matrix.os }}
|
|
44
|
+
runs-on: ${{ matrix.os }}
|
|
45
|
+
strategy:
|
|
46
|
+
matrix:
|
|
47
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v4
|
|
50
|
+
|
|
51
|
+
- name: Setup Python
|
|
52
|
+
uses: actions/setup-python@v5
|
|
53
|
+
with:
|
|
54
|
+
python-version: '3.12'
|
|
55
|
+
|
|
56
|
+
- name: Install Rust
|
|
57
|
+
uses: dtolnay/rust-toolchain@stable
|
|
58
|
+
|
|
59
|
+
- name: Install uv
|
|
60
|
+
uses: astral-sh/setup-uv@v4
|
|
61
|
+
|
|
62
|
+
- name: Build wheels
|
|
63
|
+
uses: PyO3/maturin-action@v1
|
|
64
|
+
with:
|
|
65
|
+
args: --release --out dist
|
|
66
|
+
manylinux: auto
|
|
67
|
+
working-directory: .
|
|
68
|
+
|
|
69
|
+
- name: Upload wheels
|
|
70
|
+
uses: actions/upload-artifact@v4
|
|
71
|
+
with:
|
|
72
|
+
name: wheels-${{ matrix.os }}
|
|
73
|
+
path: dist/*.whl
|
|
74
|
+
|
|
75
|
+
sdist:
|
|
76
|
+
needs: check-version
|
|
77
|
+
if: needs.check-version.outputs.exists == 'false'
|
|
78
|
+
runs-on: ubuntu-latest
|
|
79
|
+
steps:
|
|
80
|
+
- uses: actions/checkout@v4
|
|
81
|
+
|
|
82
|
+
- name: Build sdist
|
|
83
|
+
uses: PyO3/maturin-action@v1
|
|
84
|
+
with:
|
|
85
|
+
command: sdist
|
|
86
|
+
args: --out dist
|
|
87
|
+
|
|
88
|
+
- name: Upload sdist
|
|
89
|
+
uses: actions/upload-artifact@v4
|
|
90
|
+
with:
|
|
91
|
+
name: sdist
|
|
92
|
+
path: dist/*.tar.gz
|
|
93
|
+
|
|
94
|
+
release-and-publish:
|
|
95
|
+
needs: [check-version, build, sdist]
|
|
96
|
+
if: needs.check-version.outputs.exists == 'false'
|
|
97
|
+
runs-on: ubuntu-latest
|
|
98
|
+
environment:
|
|
99
|
+
name: pypi
|
|
100
|
+
url: https://pypi.org/p/ormkit
|
|
101
|
+
steps:
|
|
102
|
+
- uses: actions/checkout@v4
|
|
103
|
+
with:
|
|
104
|
+
fetch-depth: 0
|
|
105
|
+
|
|
106
|
+
- name: Create tag
|
|
107
|
+
run: |
|
|
108
|
+
git config user.name "github-actions[bot]"
|
|
109
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
110
|
+
git tag "v${{ needs.check-version.outputs.version }}"
|
|
111
|
+
git push origin "v${{ needs.check-version.outputs.version }}"
|
|
112
|
+
|
|
113
|
+
- name: Create GitHub Release
|
|
114
|
+
uses: softprops/action-gh-release@v2
|
|
115
|
+
with:
|
|
116
|
+
tag_name: v${{ needs.check-version.outputs.version }}
|
|
117
|
+
generate_release_notes: true
|
|
118
|
+
draft: false
|
|
119
|
+
prerelease: false
|
|
120
|
+
|
|
121
|
+
- name: Download all artifacts
|
|
122
|
+
uses: actions/download-artifact@v4
|
|
123
|
+
with:
|
|
124
|
+
path: dist
|
|
125
|
+
merge-multiple: true
|
|
126
|
+
|
|
127
|
+
- name: Publish to PyPI
|
|
128
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Superseded by publish.yml
|
ormkit-0.1.4/.gitignore
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.egg-info/
|
|
6
|
+
*.egg
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
wheels/
|
|
10
|
+
.eggs/
|
|
11
|
+
.venv/
|
|
12
|
+
|
|
13
|
+
# Rust
|
|
14
|
+
target/
|
|
15
|
+
|
|
16
|
+
# IDE
|
|
17
|
+
.idea/
|
|
18
|
+
.vscode/
|
|
19
|
+
*.swp
|
|
20
|
+
*.swo
|
|
21
|
+
*~
|
|
22
|
+
|
|
23
|
+
# OS
|
|
24
|
+
.DS_Store
|
|
25
|
+
Thumbs.db
|
|
26
|
+
|
|
27
|
+
# Testing
|
|
28
|
+
.pytest_cache/
|
|
29
|
+
.coverage
|
|
30
|
+
htmlcov/
|
|
31
|
+
.mypy_cache/
|
|
32
|
+
.benchmarks/
|
|
33
|
+
|
|
34
|
+
# Build artifacts (compiled extensions)
|
|
35
|
+
*.so
|
|
36
|
+
*.dylib
|
|
37
|
+
*.dll
|
|
38
|
+
*.pyd
|
|
39
|
+
|
|
40
|
+
# MkDocs build output
|
|
41
|
+
site/
|
|
42
|
+
|
|
43
|
+
# Environment files
|
|
44
|
+
.env
|
|
45
|
+
.env.*
|
|
46
|
+
!.env.example
|
|
47
|
+
|
|
48
|
+
# Claude artifacts
|
|
49
|
+
.claude/
|