django-pyturso 0.1.0__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 (75) hide show
  1. django_pyturso-0.1.0/LICENSE +21 -0
  2. django_pyturso-0.1.0/PKG-INFO +77 -0
  3. django_pyturso-0.1.0/README.md +60 -0
  4. django_pyturso-0.1.0/THIRD_PARTY_NOTICES.md +32 -0
  5. django_pyturso-0.1.0/pyproject.toml +108 -0
  6. django_pyturso-0.1.0/src/django_pyturso/__init__.py +1 -0
  7. django_pyturso-0.1.0/src/django_pyturso/base.py +573 -0
  8. django_pyturso-0.1.0/src/django_pyturso/client.py +18 -0
  9. django_pyturso-0.1.0/src/django_pyturso/creation.py +78 -0
  10. django_pyturso-0.1.0/src/django_pyturso/features.py +191 -0
  11. django_pyturso-0.1.0/src/django_pyturso/introspection.py +578 -0
  12. django_pyturso-0.1.0/src/django_pyturso/operations.py +495 -0
  13. django_pyturso-0.1.0/src/django_pyturso/py.typed +1 -0
  14. django_pyturso-0.1.0/src/django_pyturso/schema.py +462 -0
  15. django_pyturso-0.1.0/tests/__init__.py +1 -0
  16. django_pyturso-0.1.0/tests/architecture/test_boundaries.py +158 -0
  17. django_pyturso-0.1.0/tests/core/constraints/__init__.py +1 -0
  18. django_pyturso-0.1.0/tests/core/constraints/test_foreign_keys.py +181 -0
  19. django_pyturso-0.1.0/tests/core/test_base_branches.py +309 -0
  20. django_pyturso-0.1.0/tests/core/test_base_contracts.py +227 -0
  21. django_pyturso-0.1.0/tests/core/test_client.py +19 -0
  22. django_pyturso-0.1.0/tests/core/test_connection.py +159 -0
  23. django_pyturso-0.1.0/tests/core/test_creation.py +142 -0
  24. django_pyturso-0.1.0/tests/core/test_features.py +63 -0
  25. django_pyturso-0.1.0/tests/core/test_introspection.py +397 -0
  26. django_pyturso-0.1.0/tests/core/test_migration_corpus.py +329 -0
  27. django_pyturso-0.1.0/tests/core/test_operations.py +420 -0
  28. django_pyturso-0.1.0/tests/core/test_operations_contracts.py +196 -0
  29. django_pyturso-0.1.0/tests/core/test_orm.py +92 -0
  30. django_pyturso-0.1.0/tests/core/test_schema.py +349 -0
  31. django_pyturso-0.1.0/tests/core/test_schema_alteration.py +262 -0
  32. django_pyturso-0.1.0/tests/core/test_schema_branches.py +653 -0
  33. django_pyturso-0.1.0/tests/core/test_schema_editor_lifecycle.py +132 -0
  34. django_pyturso-0.1.0/tests/core/test_schema_table_remake_fields.py +275 -0
  35. django_pyturso-0.1.0/tests/core/test_schema_table_remake_finalization.py +66 -0
  36. django_pyturso-0.1.0/tests/core/test_schema_table_remake_options.py +106 -0
  37. django_pyturso-0.1.0/tests/core/transactions/test_state_machine.py +370 -0
  38. django_pyturso-0.1.0/tests/differential/__init__.py +1 -0
  39. django_pyturso-0.1.0/tests/differential/file_interop_runner.py +105 -0
  40. django_pyturso-0.1.0/tests/differential/runner.py +314 -0
  41. django_pyturso-0.1.0/tests/differential/test_scenarios.py +184 -0
  42. django_pyturso-0.1.0/tests/fault_injection/test_connection_initialization.py +108 -0
  43. django_pyturso-0.1.0/tests/integration/test_test_runner.py +130 -0
  44. django_pyturso-0.1.0/tests/integration/test_user_paths.py +40 -0
  45. django_pyturso-0.1.0/tests/project/__init__.py +3 -0
  46. django_pyturso-0.1.0/tests/project/admin.py +11 -0
  47. django_pyturso-0.1.0/tests/project/apps.py +8 -0
  48. django_pyturso-0.1.0/tests/project/fixtures/entries.json +10 -0
  49. django_pyturso-0.1.0/tests/project/forms.py +11 -0
  50. django_pyturso-0.1.0/tests/project/live_server_case.py +13 -0
  51. django_pyturso-0.1.0/tests/project/manage.py +20 -0
  52. django_pyturso-0.1.0/tests/project/migrations/0001_initial.py +53 -0
  53. django_pyturso-0.1.0/tests/project/migrations/__init__.py +0 -0
  54. django_pyturso-0.1.0/tests/project/mirror_case.py +13 -0
  55. django_pyturso-0.1.0/tests/project/models.py +28 -0
  56. django_pyturso-0.1.0/tests/project/serialized_case.py +18 -0
  57. django_pyturso-0.1.0/tests/project/tests.py +19 -0
  58. django_pyturso-0.1.0/tests/project/urls.py +6 -0
  59. django_pyturso-0.1.0/tests/property/test_cursor_and_values.py +144 -0
  60. django_pyturso-0.1.0/tests/property/test_transaction_sequences.py +94 -0
  61. django_pyturso-0.1.0/tests/security/__init__.py +1 -0
  62. django_pyturso-0.1.0/tests/security/test_database_paths.py +102 -0
  63. django_pyturso-0.1.0/tests/security/test_sql_inputs.py +83 -0
  64. django_pyturso-0.1.0/tests/settings/__init__.py +1 -0
  65. django_pyturso-0.1.0/tests/settings/base.py +45 -0
  66. django_pyturso-0.1.0/tests/settings/sqlite.py +5 -0
  67. django_pyturso-0.1.0/tests/settings/turso_file.py +15 -0
  68. django_pyturso-0.1.0/tests/settings/turso_file_mirror.py +8 -0
  69. django_pyturso-0.1.0/tests/settings/turso_memory.py +5 -0
  70. django_pyturso-0.1.0/tests/settings/turso_memory_mirror.py +8 -0
  71. django_pyturso-0.1.0/tests/snapshots/schema/migration-corpus.json +39 -0
  72. django_pyturso-0.1.0/tests/stress/_crash_writer.py +20 -0
  73. django_pyturso-0.1.0/tests/stress/test_file_recovery_and_resources.py +103 -0
  74. django_pyturso-0.1.0/tests/support.py +24 -0
  75. django_pyturso-0.1.0/tests/test_package.py +36 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 B.T. Franklin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.4
2
+ Name: django-pyturso
3
+ Version: 0.1.0
4
+ Summary: A Django database backend for the embedded Turso database engine
5
+ Author: B.T. Franklin
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ License-File: THIRD_PARTY_NOTICES.md
9
+ Classifier: Development Status :: 2 - Pre-Alpha
10
+ Classifier: Framework :: Django :: 6.0
11
+ Classifier: Programming Language :: Python :: 3.14
12
+ Classifier: Typing :: Typed
13
+ Requires-Python: >=3.14
14
+ Requires-Dist: Django>=6.0.7
15
+ Requires-Dist: pyturso>=0.7.0
16
+ Description-Content-Type: text/markdown
17
+
18
+ # django-pyturso
19
+
20
+ ![django-pyturso banner](https://raw.githubusercontent.com/btfranklin/django-pyturso/main/.github/social%20preview/django_pyturso_social_preview.jpg "django-pyturso")
21
+
22
+ `django-pyturso` is a Django database backend for the embedded Turso database
23
+ engine exposed by `pyturso`. It will let a Django project use its ordinary ORM,
24
+ migrations, forms, admin, and transaction APIs against a local Turso database
25
+ file.
26
+
27
+ This repository is deliberately scoped to embedded, local Turso. It does not
28
+ provide Turso Cloud access, libSQL-over-HTTP support, replication, sync, or a
29
+ project-specific compatibility layer.
30
+
31
+ ## Status
32
+
33
+ The pre-release backend is implemented and covered by focused tests for ORM,
34
+ migrations, transactions, Django integration, driver behavior, and package
35
+ installation. Publication remains a separate, explicitly authorized action.
36
+
37
+ The v1 contract intentionally excludes writing non-NULL Django `BinaryField`
38
+ values because the stable `pyturso` 0.7 line does not expose the required PEP
39
+ 249 `Binary()` constructor. The backend deliberately does not patch or wrap the
40
+ real `turso` module. See the compatibility document before evaluating the
41
+ package.
42
+
43
+ ## Quickstart
44
+
45
+ ```bash
46
+ pdm install --group dev
47
+ pdm run check
48
+ ```
49
+
50
+ Configure a Django database with no external service:
51
+
52
+ ```python
53
+ DATABASES = {
54
+ "default": {
55
+ "ENGINE": "django_pyturso",
56
+ "NAME": BASE_DIR / "db.sqlite3",
57
+ }
58
+ }
59
+ ```
60
+
61
+ The package requires CPython 3.14 or later and targets Django 6 and embedded
62
+ local Turso through `pyturso`. Cloud transports, remote sync, SQLite fallbacks,
63
+ compatibility shims, and experimental engine features are excluded.
64
+
65
+ ## Navigation
66
+
67
+ - [Architecture](docs/architecture.md)
68
+ - [Backend contract](docs/design/backend-contract.md)
69
+ - [Configuration](docs/configuration.md)
70
+ - [Compatibility status](docs/compatibility.md)
71
+ - [Test runner](docs/test-runner.md)
72
+ - [Testing](docs/testing.md)
73
+ - [Security and supply chain](docs/security.md)
74
+ - [Post-v1 roadmap](docs/roadmap.md)
75
+ - [Releasing](docs/releasing.md)
76
+ - [Documentation index](docs/index.md)
77
+ - [Agent operating guide](AGENTS.md)
@@ -0,0 +1,60 @@
1
+ # django-pyturso
2
+
3
+ ![django-pyturso banner](https://raw.githubusercontent.com/btfranklin/django-pyturso/main/.github/social%20preview/django_pyturso_social_preview.jpg "django-pyturso")
4
+
5
+ `django-pyturso` is a Django database backend for the embedded Turso database
6
+ engine exposed by `pyturso`. It will let a Django project use its ordinary ORM,
7
+ migrations, forms, admin, and transaction APIs against a local Turso database
8
+ file.
9
+
10
+ This repository is deliberately scoped to embedded, local Turso. It does not
11
+ provide Turso Cloud access, libSQL-over-HTTP support, replication, sync, or a
12
+ project-specific compatibility layer.
13
+
14
+ ## Status
15
+
16
+ The pre-release backend is implemented and covered by focused tests for ORM,
17
+ migrations, transactions, Django integration, driver behavior, and package
18
+ installation. Publication remains a separate, explicitly authorized action.
19
+
20
+ The v1 contract intentionally excludes writing non-NULL Django `BinaryField`
21
+ values because the stable `pyturso` 0.7 line does not expose the required PEP
22
+ 249 `Binary()` constructor. The backend deliberately does not patch or wrap the
23
+ real `turso` module. See the compatibility document before evaluating the
24
+ package.
25
+
26
+ ## Quickstart
27
+
28
+ ```bash
29
+ pdm install --group dev
30
+ pdm run check
31
+ ```
32
+
33
+ Configure a Django database with no external service:
34
+
35
+ ```python
36
+ DATABASES = {
37
+ "default": {
38
+ "ENGINE": "django_pyturso",
39
+ "NAME": BASE_DIR / "db.sqlite3",
40
+ }
41
+ }
42
+ ```
43
+
44
+ The package requires CPython 3.14 or later and targets Django 6 and embedded
45
+ local Turso through `pyturso`. Cloud transports, remote sync, SQLite fallbacks,
46
+ compatibility shims, and experimental engine features are excluded.
47
+
48
+ ## Navigation
49
+
50
+ - [Architecture](docs/architecture.md)
51
+ - [Backend contract](docs/design/backend-contract.md)
52
+ - [Configuration](docs/configuration.md)
53
+ - [Compatibility status](docs/compatibility.md)
54
+ - [Test runner](docs/test-runner.md)
55
+ - [Testing](docs/testing.md)
56
+ - [Security and supply chain](docs/security.md)
57
+ - [Post-v1 roadmap](docs/roadmap.md)
58
+ - [Releasing](docs/releasing.md)
59
+ - [Documentation index](docs/index.md)
60
+ - [Agent operating guide](AGENTS.md)
@@ -0,0 +1,32 @@
1
+ # Third-Party Notices
2
+
3
+ Portions of this distribution are adapted from Django 6.0.7, commit
4
+ `e2a424605ac2e7e6e799496542fb2997207e2f23`.
5
+
6
+ Django is licensed under the BSD 3-Clause License:
7
+
8
+ Copyright (c) Django Software Foundation and individual contributors.
9
+ All rights reserved.
10
+
11
+ Redistribution and use in source and binary forms, with or without
12
+ modification, are permitted provided that the following conditions are met:
13
+
14
+ 1. Redistributions of source code must retain the above copyright notice,
15
+ this list of conditions and the following disclaimer.
16
+ 2. Redistributions in binary form must reproduce the above copyright notice,
17
+ this list of conditions and the following disclaimer in the documentation
18
+ and/or other materials provided with the distribution.
19
+ 3. Neither the name of Django nor the names of its contributors may be used to
20
+ endorse or promote products derived from this software without specific
21
+ prior written permission.
22
+
23
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
27
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,108 @@
1
+ [project]
2
+ name = "django-pyturso"
3
+ dynamic = []
4
+ description = "A Django database backend for the embedded Turso database engine"
5
+ readme = "README.md"
6
+ requires-python = ">=3.14"
7
+ license = "MIT"
8
+ license-files = [
9
+ "LICENSE",
10
+ "THIRD_PARTY_NOTICES.md",
11
+ ]
12
+ authors = [
13
+ { name = "B.T. Franklin" },
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 2 - Pre-Alpha",
17
+ "Framework :: Django :: 6.0",
18
+ "Programming Language :: Python :: 3.14",
19
+ "Typing :: Typed",
20
+ ]
21
+ dependencies = [
22
+ "Django>=6.0.7",
23
+ "pyturso>=0.7.0",
24
+ ]
25
+ version = "0.1.0"
26
+
27
+ [dependency-groups]
28
+ dev = [
29
+ "pytest>=9.1.1",
30
+ "pytest-django>=4.12.0",
31
+ "ruff>=0.15.21",
32
+ "mypy>=2.3.0",
33
+ "django-stubs>=6.0.6",
34
+ "hypothesis>=6.156.6",
35
+ "pytest-timeout>=2.4.0",
36
+ "build>=1.5.1",
37
+ "psutil>=7.2.2",
38
+ ]
39
+
40
+ [build-system]
41
+ requires = [
42
+ "pdm-backend>=2.4.9",
43
+ ]
44
+ build-backend = "pdm.backend"
45
+
46
+ [tool.pdm.version]
47
+ source = "scm"
48
+ fallback_version = "0.0.0"
49
+
50
+ [tool.pdm.scripts]
51
+ lint = "ruff check ."
52
+ typecheck = "mypy src tests"
53
+ test = "pytest"
54
+ test-fast = "pytest --maxfail=1 -m 'not integration and not stress'"
55
+ test-differential = "pytest -m differential"
56
+ test-integration = "pytest -m integration"
57
+ test-stress = "pytest -m stress"
58
+ build = "pdm build"
59
+ package-test = "python scripts/verify_packages.py"
60
+ verify-release = "python scripts/verify_packages.py"
61
+
62
+ [tool.pdm.scripts.check]
63
+ composite = [
64
+ "lint",
65
+ "typecheck",
66
+ "test-fast",
67
+ ]
68
+
69
+ [tool.pytest.ini_options]
70
+ testpaths = [
71
+ "tests",
72
+ ]
73
+ pythonpath = [
74
+ ".",
75
+ ]
76
+ DJANGO_SETTINGS_MODULE = "tests.settings.turso_memory"
77
+ markers = [
78
+ "core: complete supported core-backend behavior",
79
+ "differential: SQLite and Turso scenario comparison",
80
+ "integration: cross-component and subprocess integration",
81
+ "stress: long-running and recovery evidence",
82
+ ]
83
+
84
+ [tool.ruff]
85
+ target-version = "py314"
86
+ line-length = 100
87
+
88
+ [tool.ruff.lint]
89
+ select = [
90
+ "E",
91
+ "F",
92
+ "W",
93
+ "I",
94
+ ]
95
+
96
+ [tool.mypy]
97
+ python_version = "3.14"
98
+ strict = true
99
+ files = [
100
+ "src",
101
+ "tests",
102
+ ]
103
+ plugins = [
104
+ "mypy_django_plugin.main",
105
+ ]
106
+
107
+ [tool.django-stubs]
108
+ django_settings_module = "tests.settings.turso_memory"
@@ -0,0 +1 @@
1
+ """Django database backend for embedded Turso."""