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.
Files changed (113) hide show
  1. ormkit-0.1.4/.github/workflows/ci.yml +79 -0
  2. ormkit-0.1.4/.github/workflows/docs.yml +59 -0
  3. ormkit-0.1.4/.github/workflows/publish.yml +128 -0
  4. ormkit-0.1.4/.github/workflows/release.yml +1 -0
  5. ormkit-0.1.4/.gitignore +49 -0
  6. ormkit-0.1.4/Cargo.lock +1211 -0
  7. ormkit-0.1.4/Cargo.toml +66 -0
  8. ormkit-0.1.4/PKG-INFO +521 -0
  9. ormkit-0.1.4/README.md +501 -0
  10. ormkit-0.1.4/benchmarks/RESULTS.md +13 -0
  11. ormkit-0.1.4/benchmarks/__init__.py +0 -0
  12. ormkit-0.1.4/benchmarks/bench_json.py +760 -0
  13. ormkit-0.1.4/benchmarks/bench_m2m.py +290 -0
  14. ormkit-0.1.4/benchmarks/bench_soft_delete.py +226 -0
  15. ormkit-0.1.4/benchmarks/bench_sqlite.py +221 -0
  16. ormkit-0.1.4/benchmarks/bench_upsert.py +203 -0
  17. ormkit-0.1.4/benchmarks/breakdown.py +104 -0
  18. ormkit-0.1.4/benchmarks/compare_postgres.py +828 -0
  19. ormkit-0.1.4/benchmarks/compare_raw.py +138 -0
  20. ormkit-0.1.4/benchmarks/conftest.py +33 -0
  21. ormkit-0.1.4/benchmarks/docker-compose.yml +18 -0
  22. ormkit-0.1.4/benchmarks/isolated/__init__.py +1 -0
  23. ormkit-0.1.4/benchmarks/isolated/aiosqlite_bench.py +76 -0
  24. ormkit-0.1.4/benchmarks/isolated/asyncpg_bench.py +138 -0
  25. ormkit-0.1.4/benchmarks/isolated/databases_bench.py +46 -0
  26. ormkit-0.1.4/benchmarks/isolated/helpers.py +45 -0
  27. ormkit-0.1.4/benchmarks/isolated/ormar_bench.py +103 -0
  28. ormkit-0.1.4/benchmarks/isolated/ormkit_postgres.py +138 -0
  29. ormkit-0.1.4/benchmarks/isolated/ormkit_sqlite.py +74 -0
  30. ormkit-0.1.4/benchmarks/isolated/piccolo_bench.py +64 -0
  31. ormkit-0.1.4/benchmarks/isolated/seed_postgres.py +47 -0
  32. ormkit-0.1.4/benchmarks/isolated/sqlalchemy_bench.py +63 -0
  33. ormkit-0.1.4/benchmarks/isolated/tortoise_bench.py +61 -0
  34. ormkit-0.1.4/benchmarks/micro_bench.py +176 -0
  35. ormkit-0.1.4/benchmarks/results.json +128 -0
  36. ormkit-0.1.4/benchmarks/run_all.py +359 -0
  37. ormkit-0.1.4/benchmarks/runner.py +710 -0
  38. ormkit-0.1.4/docs/api/engine.md +267 -0
  39. ormkit-0.1.4/docs/api/index.md +69 -0
  40. ormkit-0.1.4/docs/api/models.md +402 -0
  41. ormkit-0.1.4/docs/api/query.md +477 -0
  42. ormkit-0.1.4/docs/api/session.md +407 -0
  43. ormkit-0.1.4/docs/contributing/architecture.md +368 -0
  44. ormkit-0.1.4/docs/contributing/development.md +205 -0
  45. ormkit-0.1.4/docs/contributing/index.md +25 -0
  46. ormkit-0.1.4/docs/getting-started/first-app.md +284 -0
  47. ormkit-0.1.4/docs/getting-started/index.md +50 -0
  48. ormkit-0.1.4/docs/getting-started/installation.md +125 -0
  49. ormkit-0.1.4/docs/getting-started/quickstart.md +246 -0
  50. ormkit-0.1.4/docs/guide/index.md +90 -0
  51. ormkit-0.1.4/docs/guide/models.md +219 -0
  52. ormkit-0.1.4/docs/guide/queries.md +433 -0
  53. ormkit-0.1.4/docs/guide/raw-sql.md +284 -0
  54. ormkit-0.1.4/docs/guide/relationships.md +290 -0
  55. ormkit-0.1.4/docs/guide/transactions.md +214 -0
  56. ormkit-0.1.4/docs/includes/abbreviations.md +8 -0
  57. ormkit-0.1.4/docs/index.md +206 -0
  58. ormkit-0.1.4/docs/performance/benchmarks.md +184 -0
  59. ormkit-0.1.4/docs/performance/index.md +86 -0
  60. ormkit-0.1.4/docs/performance/optimization.md +302 -0
  61. ormkit-0.1.4/docs/stylesheets/extra.css +174 -0
  62. ormkit-0.1.4/mkdocs.yml +148 -0
  63. ormkit-0.1.4/pyproject.toml +111 -0
  64. ormkit-0.1.4/python/ormkit/__init__.py +79 -0
  65. ormkit-0.1.4/python/ormkit/_foreignkey.pyi +76 -0
  66. ormkit-0.1.4/python/ormkit/base.py +399 -0
  67. ormkit-0.1.4/python/ormkit/cli/__init__.py +700 -0
  68. ormkit-0.1.4/python/ormkit/fields.py +227 -0
  69. ormkit-0.1.4/python/ormkit/migrations/__init__.py +58 -0
  70. ormkit-0.1.4/python/ormkit/migrations/autogen.py +566 -0
  71. ormkit-0.1.4/python/ormkit/migrations/config.py +330 -0
  72. ormkit-0.1.4/python/ormkit/migrations/operations.py +522 -0
  73. ormkit-0.1.4/python/ormkit/migrations/runner.py +427 -0
  74. ormkit-0.1.4/python/ormkit/migrations/script.py +568 -0
  75. ormkit-0.1.4/python/ormkit/mixins.py +93 -0
  76. ormkit-0.1.4/python/ormkit/py.typed +0 -0
  77. ormkit-0.1.4/python/ormkit/query.py +460 -0
  78. ormkit-0.1.4/python/ormkit/relationships.py +394 -0
  79. ormkit-0.1.4/python/ormkit/session.py +1912 -0
  80. ormkit-0.1.4/src/error.rs +44 -0
  81. ormkit-0.1.4/src/executor.rs +451 -0
  82. ormkit-0.1.4/src/lib.rs +52 -0
  83. ormkit-0.1.4/src/pg/connection.rs +1105 -0
  84. ormkit-0.1.4/src/pg/error.rs +88 -0
  85. ormkit-0.1.4/src/pg/mod.rs +35 -0
  86. ormkit-0.1.4/src/pg/pool.rs +356 -0
  87. ormkit-0.1.4/src/pg/protocol.rs +738 -0
  88. ormkit-0.1.4/src/pg/scram.rs +274 -0
  89. ormkit-0.1.4/src/pg/statement.rs +297 -0
  90. ormkit-0.1.4/src/pg/tests.rs +786 -0
  91. ormkit-0.1.4/src/pg/types.rs +428 -0
  92. ormkit-0.1.4/src/pool.rs +1158 -0
  93. ormkit-0.1.4/src/schema.rs +216 -0
  94. ormkit-0.1.4/src/sqlite/connection.rs +167 -0
  95. ormkit-0.1.4/src/sqlite/error.rs +60 -0
  96. ormkit-0.1.4/src/sqlite/mod.rs +20 -0
  97. ormkit-0.1.4/src/sqlite/pool.rs +187 -0
  98. ormkit-0.1.4/src/sqlite/tests.rs +99 -0
  99. ormkit-0.1.4/src/sqlite/types.rs +123 -0
  100. ormkit-0.1.4/tests/__init__.py +0 -0
  101. ormkit-0.1.4/tests/conftest.py +33 -0
  102. ormkit-0.1.4/tests/test_json_fields.py +260 -0
  103. ormkit-0.1.4/tests/test_m2m.py +404 -0
  104. ormkit-0.1.4/tests/test_migrations.py +517 -0
  105. ormkit-0.1.4/tests/test_models.py +110 -0
  106. ormkit-0.1.4/tests/test_new_features.py +363 -0
  107. ormkit-0.1.4/tests/test_queries.py +128 -0
  108. ormkit-0.1.4/tests/test_relationships.py +228 -0
  109. ormkit-0.1.4/tests/test_session.py +192 -0
  110. ormkit-0.1.4/tests/test_session_fluent.py +320 -0
  111. ormkit-0.1.4/tests/test_soft_delete.py +370 -0
  112. ormkit-0.1.4/tests/test_upsert.py +339 -0
  113. 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
@@ -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/