rakko-orm 1.0.0a0__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 (246) hide show
  1. rakko_orm-1.0.0a0/ASSETS.md +12 -0
  2. rakko_orm-1.0.0a0/CHANGELOG.rst +54 -0
  3. rakko_orm-1.0.0a0/CONTRIBUTORS.rst +86 -0
  4. rakko_orm-1.0.0a0/LICENSE.txt +201 -0
  5. rakko_orm-1.0.0a0/LICENSE_REVIEW.md +40 -0
  6. rakko_orm-1.0.0a0/NOTICE.txt +22 -0
  7. rakko_orm-1.0.0a0/PKG-INFO +114 -0
  8. rakko_orm-1.0.0a0/README.md +125 -0
  9. rakko_orm-1.0.0a0/README.pypi.md +62 -0
  10. rakko_orm-1.0.0a0/RELEASING.md +63 -0
  11. rakko_orm-1.0.0a0/conftest.py +220 -0
  12. rakko_orm-1.0.0a0/docs/CHANGELOG.rst +5 -0
  13. rakko_orm-1.0.0a0/docs/CODE_OF_CONDUCT.rst +61 -0
  14. rakko_orm-1.0.0a0/docs/CONTRIBUTING.rst +38 -0
  15. rakko_orm-1.0.0a0/docs/CONTRIBUTORS.rst +5 -0
  16. rakko_orm-1.0.0a0/docs/Makefile +24 -0
  17. rakko_orm-1.0.0a0/docs/_static/.keep +0 -0
  18. rakko_orm-1.0.0a0/docs/_static/rakko-logo.png +0 -0
  19. rakko_orm-1.0.0a0/docs/_static/rakko-logo.prompt.txt +3 -0
  20. rakko_orm-1.0.0a0/docs/_static/rakko.css +89 -0
  21. rakko_orm-1.0.0a0/docs/_templates/space.html +1 -0
  22. rakko_orm-1.0.0a0/docs/about.rst +40 -0
  23. rakko_orm-1.0.0a0/docs/cli.rst +28 -0
  24. rakko_orm-1.0.0a0/docs/conf.py +71 -0
  25. rakko_orm-1.0.0a0/docs/connections.rst +31 -0
  26. rakko_orm-1.0.0a0/docs/contrib/aiohttp.rst +15 -0
  27. rakko_orm-1.0.0a0/docs/contrib/blacksheep.rst +15 -0
  28. rakko_orm-1.0.0a0/docs/contrib/fastapi.rst +15 -0
  29. rakko_orm-1.0.0a0/docs/contrib/linters.rst +18 -0
  30. rakko_orm-1.0.0a0/docs/contrib/mysql.rst +15 -0
  31. rakko_orm-1.0.0a0/docs/contrib/postgres.rst +15 -0
  32. rakko_orm-1.0.0a0/docs/contrib/pydantic.rst +15 -0
  33. rakko_orm-1.0.0a0/docs/contrib/quart.rst +15 -0
  34. rakko_orm-1.0.0a0/docs/contrib/sanic.rst +15 -0
  35. rakko_orm-1.0.0a0/docs/contrib/starlette.rst +15 -0
  36. rakko_orm-1.0.0a0/docs/contrib/unittest.rst +21 -0
  37. rakko_orm-1.0.0a0/docs/contrib.rst +26 -0
  38. rakko_orm-1.0.0a0/docs/databases.rst +45 -0
  39. rakko_orm-1.0.0a0/docs/design.rst +32 -0
  40. rakko_orm-1.0.0a0/docs/direct_queries.rst +15 -0
  41. rakko_orm-1.0.0a0/docs/examples/basic.rst +95 -0
  42. rakko_orm-1.0.0a0/docs/examples.rst +16 -0
  43. rakko_orm-1.0.0a0/docs/exceptions.rst +19 -0
  44. rakko_orm-1.0.0a0/docs/expressions.rst +55 -0
  45. rakko_orm-1.0.0a0/docs/fields.rst +61 -0
  46. rakko_orm-1.0.0a0/docs/functions.rst +23 -0
  47. rakko_orm-1.0.0a0/docs/getting_started.rst +34 -0
  48. rakko_orm-1.0.0a0/docs/index.rst +62 -0
  49. rakko_orm-1.0.0a0/docs/indexes.rst +16 -0
  50. rakko_orm-1.0.0a0/docs/license.rst +18 -0
  51. rakko_orm-1.0.0a0/docs/logging.rst +16 -0
  52. rakko_orm-1.0.0a0/docs/manager.rst +15 -0
  53. rakko_orm-1.0.0a0/docs/migration.rst +18 -0
  54. rakko_orm-1.0.0a0/docs/migration_guide.rst +41 -0
  55. rakko_orm-1.0.0a0/docs/models.rst +64 -0
  56. rakko_orm-1.0.0a0/docs/orm_integration.md +16 -0
  57. rakko_orm-1.0.0a0/docs/query.rst +88 -0
  58. rakko_orm-1.0.0a0/docs/reference.rst +35 -0
  59. rakko_orm-1.0.0a0/docs/releasing.rst +21 -0
  60. rakko_orm-1.0.0a0/docs/roadmap.rst +25 -0
  61. rakko_orm-1.0.0a0/docs/router.rst +14 -0
  62. rakko_orm-1.0.0a0/docs/schema.rst +21 -0
  63. rakko_orm-1.0.0a0/docs/setup.rst +26 -0
  64. rakko_orm-1.0.0a0/docs/signals.rst +16 -0
  65. rakko_orm-1.0.0a0/docs/sphinx_autodoc_typehints.py +424 -0
  66. rakko_orm-1.0.0a0/docs/timezone.rst +20 -0
  67. rakko_orm-1.0.0a0/docs/toc.rst +9 -0
  68. rakko_orm-1.0.0a0/docs/transactions.rst +32 -0
  69. rakko_orm-1.0.0a0/docs/type_globals.py +6 -0
  70. rakko_orm-1.0.0a0/docs/validators.rst +15 -0
  71. rakko_orm-1.0.0a0/examples/README.md +44 -0
  72. rakko_orm-1.0.0a0/examples/__init__.py +4 -0
  73. rakko_orm-1.0.0a0/examples/basic.py +51 -0
  74. rakko_orm-1.0.0a0/examples/bulk_and_transactions.py +69 -0
  75. rakko_orm-1.0.0a0/examples/fastapi/.gitignore +5 -0
  76. rakko_orm-1.0.0a0/examples/fastapi/__init__.py +4 -0
  77. rakko_orm-1.0.0a0/examples/fastapi/migrations/__init__.py +4 -0
  78. rakko_orm-1.0.0a0/examples/models.py +26 -0
  79. rakko_orm-1.0.0a0/examples/mysql_sql.py +34 -0
  80. rakko_orm-1.0.0a0/examples/pydantic/__init__.py +4 -0
  81. rakko_orm-1.0.0a0/examples/queries.py +66 -0
  82. rakko_orm-1.0.0a0/examples/relations.py +46 -0
  83. rakko_orm-1.0.0a0/pyproject.toml +298 -0
  84. rakko_orm-1.0.0a0/rakko/__init__.py +613 -0
  85. rakko_orm-1.0.0a0/rakko/__main__.py +10 -0
  86. rakko_orm-1.0.0a0/rakko/apps.py +356 -0
  87. rakko_orm-1.0.0a0/rakko/backends/__init__.py +4 -0
  88. rakko_orm-1.0.0a0/rakko/backends/asyncpg/__init__.py +7 -0
  89. rakko_orm-1.0.0a0/rakko/backends/asyncpg/client.py +223 -0
  90. rakko_orm-1.0.0a0/rakko/backends/asyncpg/executor.py +20 -0
  91. rakko_orm-1.0.0a0/rakko/backends/asyncpg/schema_generator.py +17 -0
  92. rakko_orm-1.0.0a0/rakko/backends/base/__init__.py +4 -0
  93. rakko_orm-1.0.0a0/rakko/backends/base/client.py +438 -0
  94. rakko_orm-1.0.0a0/rakko/backends/base/config_generator.py +249 -0
  95. rakko_orm-1.0.0a0/rakko/backends/base/executor.py +764 -0
  96. rakko_orm-1.0.0a0/rakko/backends/base/schema_generator.py +580 -0
  97. rakko_orm-1.0.0a0/rakko/backends/base_postgres/__init__.py +4 -0
  98. rakko_orm-1.0.0a0/rakko/backends/base_postgres/client.py +170 -0
  99. rakko_orm-1.0.0a0/rakko/backends/base_postgres/executor.py +149 -0
  100. rakko_orm-1.0.0a0/rakko/backends/base_postgres/schema_generator.py +84 -0
  101. rakko_orm-1.0.0a0/rakko/backends/mssql/__init__.py +7 -0
  102. rakko_orm-1.0.0a0/rakko/backends/mssql/client.py +127 -0
  103. rakko_orm-1.0.0a0/rakko/backends/mssql/executor.py +17 -0
  104. rakko_orm-1.0.0a0/rakko/backends/mssql/schema_generator.py +125 -0
  105. rakko_orm-1.0.0a0/rakko/backends/mysql/__init__.py +7 -0
  106. rakko_orm-1.0.0a0/rakko/backends/mysql/client.py +312 -0
  107. rakko_orm-1.0.0a0/rakko/backends/mysql/executor.py +154 -0
  108. rakko_orm-1.0.0a0/rakko/backends/mysql/schema_generator.py +101 -0
  109. rakko_orm-1.0.0a0/rakko/backends/odbc/__init__.py +4 -0
  110. rakko_orm-1.0.0a0/rakko/backends/odbc/client.py +221 -0
  111. rakko_orm-1.0.0a0/rakko/backends/odbc/executor.py +20 -0
  112. rakko_orm-1.0.0a0/rakko/backends/oracle/__init__.py +7 -0
  113. rakko_orm-1.0.0a0/rakko/backends/oracle/client.py +136 -0
  114. rakko_orm-1.0.0a0/rakko/backends/oracle/executor.py +27 -0
  115. rakko_orm-1.0.0a0/rakko/backends/oracle/schema_generator.py +120 -0
  116. rakko_orm-1.0.0a0/rakko/backends/psycopg/__init__.py +7 -0
  117. rakko_orm-1.0.0a0/rakko/backends/psycopg/client.py +288 -0
  118. rakko_orm-1.0.0a0/rakko/backends/psycopg/executor.py +14 -0
  119. rakko_orm-1.0.0a0/rakko/backends/psycopg/schema_generator.py +17 -0
  120. rakko_orm-1.0.0a0/rakko/backends/sqlite/__init__.py +14 -0
  121. rakko_orm-1.0.0a0/rakko/backends/sqlite/client.py +299 -0
  122. rakko_orm-1.0.0a0/rakko/backends/sqlite/executor.py +88 -0
  123. rakko_orm-1.0.0a0/rakko/backends/sqlite/schema_generator.py +32 -0
  124. rakko_orm-1.0.0a0/rakko/cli/__init__.py +13 -0
  125. rakko_orm-1.0.0a0/rakko/cli/cli.py +878 -0
  126. rakko_orm-1.0.0a0/rakko/cli/utils.py +181 -0
  127. rakko_orm-1.0.0a0/rakko/config.py +315 -0
  128. rakko_orm-1.0.0a0/rakko/connection.py +345 -0
  129. rakko_orm-1.0.0a0/rakko/context.py +571 -0
  130. rakko_orm-1.0.0a0/rakko/contrib/__init__.py +4 -0
  131. rakko_orm-1.0.0a0/rakko/contrib/aiohttp/__init__.py +99 -0
  132. rakko_orm-1.0.0a0/rakko/contrib/blacksheep/__init__.py +121 -0
  133. rakko_orm-1.0.0a0/rakko/contrib/fastapi/__init__.py +301 -0
  134. rakko_orm-1.0.0a0/rakko/contrib/mysql/__init__.py +4 -0
  135. rakko_orm-1.0.0a0/rakko/contrib/mysql/fields.py +63 -0
  136. rakko_orm-1.0.0a0/rakko/contrib/mysql/functions.py +19 -0
  137. rakko_orm-1.0.0a0/rakko/contrib/mysql/indexes.py +28 -0
  138. rakko_orm-1.0.0a0/rakko/contrib/mysql/json_functions.py +80 -0
  139. rakko_orm-1.0.0a0/rakko/contrib/mysql/search.py +49 -0
  140. rakko_orm-1.0.0a0/rakko/contrib/postgres/__init__.py +4 -0
  141. rakko_orm-1.0.0a0/rakko/contrib/postgres/array_functions.py +35 -0
  142. rakko_orm-1.0.0a0/rakko/contrib/postgres/fields.py +105 -0
  143. rakko_orm-1.0.0a0/rakko/contrib/postgres/functions.py +43 -0
  144. rakko_orm-1.0.0a0/rakko/contrib/postgres/indexes.py +33 -0
  145. rakko_orm-1.0.0a0/rakko/contrib/postgres/json_functions.py +113 -0
  146. rakko_orm-1.0.0a0/rakko/contrib/postgres/regex.py +31 -0
  147. rakko_orm-1.0.0a0/rakko/contrib/postgres/search.py +483 -0
  148. rakko_orm-1.0.0a0/rakko/contrib/pydantic/__init__.py +16 -0
  149. rakko_orm-1.0.0a0/rakko/contrib/pydantic/base.py +147 -0
  150. rakko_orm-1.0.0a0/rakko/contrib/pydantic/creator.py +681 -0
  151. rakko_orm-1.0.0a0/rakko/contrib/pydantic/descriptions.py +207 -0
  152. rakko_orm-1.0.0a0/rakko/contrib/pydantic/utils.py +38 -0
  153. rakko_orm-1.0.0a0/rakko/contrib/pylint/__init__.py +158 -0
  154. rakko_orm-1.0.0a0/rakko/contrib/quart/__init__.py +117 -0
  155. rakko_orm-1.0.0a0/rakko/contrib/sanic/__init__.py +116 -0
  156. rakko_orm-1.0.0a0/rakko/contrib/sqlite/__init__.py +4 -0
  157. rakko_orm-1.0.0a0/rakko/contrib/sqlite/functions.py +16 -0
  158. rakko_orm-1.0.0a0/rakko/contrib/sqlite/regex.py +46 -0
  159. rakko_orm-1.0.0a0/rakko/contrib/starlette/__init__.py +180 -0
  160. rakko_orm-1.0.0a0/rakko/contrib/test/__init__.py +336 -0
  161. rakko_orm-1.0.0a0/rakko/contrib/test/condition.py +42 -0
  162. rakko_orm-1.0.0a0/rakko/converters.py +160 -0
  163. rakko_orm-1.0.0a0/rakko/exceptions.py +130 -0
  164. rakko_orm-1.0.0a0/rakko/expressions.py +962 -0
  165. rakko_orm-1.0.0a0/rakko/fields/__init__.py +111 -0
  166. rakko_orm-1.0.0a0/rakko/fields/base.py +685 -0
  167. rakko_orm-1.0.0a0/rakko/fields/data.py +1308 -0
  168. rakko_orm-1.0.0a0/rakko/fields/db_defaults.py +105 -0
  169. rakko_orm-1.0.0a0/rakko/fields/relational.py +703 -0
  170. rakko_orm-1.0.0a0/rakko/filters.py +639 -0
  171. rakko_orm-1.0.0a0/rakko/functions.py +142 -0
  172. rakko_orm-1.0.0a0/rakko/indexes.py +165 -0
  173. rakko_orm-1.0.0a0/rakko/log.py +8 -0
  174. rakko_orm-1.0.0a0/rakko/manager.py +29 -0
  175. rakko_orm-1.0.0a0/rakko/migrations/__init__.py +41 -0
  176. rakko_orm-1.0.0a0/rakko/migrations/api/__init__.py +16 -0
  177. rakko_orm-1.0.0a0/rakko/migrations/api/migrate.py +77 -0
  178. rakko_orm-1.0.0a0/rakko/migrations/api/plan.py +76 -0
  179. rakko_orm-1.0.0a0/rakko/migrations/api/sqlmigrate.py +69 -0
  180. rakko_orm-1.0.0a0/rakko/migrations/autodetector.py +203 -0
  181. rakko_orm-1.0.0a0/rakko/migrations/constraints.py +31 -0
  182. rakko_orm-1.0.0a0/rakko/migrations/exceptions.py +10 -0
  183. rakko_orm-1.0.0a0/rakko/migrations/executor.py +368 -0
  184. rakko_orm-1.0.0a0/rakko/migrations/expressions.py +13 -0
  185. rakko_orm-1.0.0a0/rakko/migrations/graph.py +158 -0
  186. rakko_orm-1.0.0a0/rakko/migrations/loader.py +127 -0
  187. rakko_orm-1.0.0a0/rakko/migrations/migration.py +189 -0
  188. rakko_orm-1.0.0a0/rakko/migrations/operations.py +1288 -0
  189. rakko_orm-1.0.0a0/rakko/migrations/recorder.py +104 -0
  190. rakko_orm-1.0.0a0/rakko/migrations/schema_editor/__init__.py +25 -0
  191. rakko_orm-1.0.0a0/rakko/migrations/schema_editor/asyncpg.py +11 -0
  192. rakko_orm-1.0.0a0/rakko/migrations/schema_editor/base.py +945 -0
  193. rakko_orm-1.0.0a0/rakko/migrations/schema_editor/base_postgres.py +171 -0
  194. rakko_orm-1.0.0a0/rakko/migrations/schema_editor/data.py +18 -0
  195. rakko_orm-1.0.0a0/rakko/migrations/schema_editor/mssql.py +339 -0
  196. rakko_orm-1.0.0a0/rakko/migrations/schema_editor/mysql.py +408 -0
  197. rakko_orm-1.0.0a0/rakko/migrations/schema_editor/oracle.py +259 -0
  198. rakko_orm-1.0.0a0/rakko/migrations/schema_editor/psycopg.py +11 -0
  199. rakko_orm-1.0.0a0/rakko/migrations/schema_editor/sqlite.py +424 -0
  200. rakko_orm-1.0.0a0/rakko/migrations/schema_generator/__init__.py +5 -0
  201. rakko_orm-1.0.0a0/rakko/migrations/schema_generator/operation_generator.py +163 -0
  202. rakko_orm-1.0.0a0/rakko/migrations/schema_generator/state.py +224 -0
  203. rakko_orm-1.0.0a0/rakko/migrations/schema_generator/state_apps.py +165 -0
  204. rakko_orm-1.0.0a0/rakko/migrations/schema_generator/state_diff.py +419 -0
  205. rakko_orm-1.0.0a0/rakko/migrations/writer.py +515 -0
  206. rakko_orm-1.0.0a0/rakko/models.py +1854 -0
  207. rakko_orm-1.0.0a0/rakko/py.typed +0 -0
  208. rakko_orm-1.0.0a0/rakko/query_api.py +134 -0
  209. rakko_orm-1.0.0a0/rakko/query_utils.py +238 -0
  210. rakko_orm-1.0.0a0/rakko/queryset.py +2743 -0
  211. rakko_orm-1.0.0a0/rakko/relations.py +85 -0
  212. rakko_orm-1.0.0a0/rakko/router.py +55 -0
  213. rakko_orm-1.0.0a0/rakko/schema_quoting.py +62 -0
  214. rakko_orm-1.0.0a0/rakko/signals.py +73 -0
  215. rakko_orm-1.0.0a0/rakko/timezone.py +173 -0
  216. rakko_orm-1.0.0a0/rakko/transactions.py +69 -0
  217. rakko_orm-1.0.0a0/rakko/utils.py +50 -0
  218. rakko_orm-1.0.0a0/rakko/validators.py +412 -0
  219. rakko_orm-1.0.0a0/rakko/warnings.py +22 -0
  220. rakko_orm-1.0.0a0/tests/__init__.py +4 -0
  221. rakko_orm-1.0.0a0/tests/backends/__init__.py +4 -0
  222. rakko_orm-1.0.0a0/tests/backends/test_connection_params.py +258 -0
  223. rakko_orm-1.0.0a0/tests/backends/test_db_url.py +519 -0
  224. rakko_orm-1.0.0a0/tests/backends/test_password_factory.py +144 -0
  225. rakko_orm-1.0.0a0/tests/cli/conftest.py +10 -0
  226. rakko_orm-1.0.0a0/tests/cli/test_utils.py +131 -0
  227. rakko_orm-1.0.0a0/tests/contrib/__init__.py +4 -0
  228. rakko_orm-1.0.0a0/tests/contrib/mysql/__init__.py +4 -0
  229. rakko_orm-1.0.0a0/tests/contrib/postgres/__init__.py +4 -0
  230. rakko_orm-1.0.0a0/tests/contrib/test_blacksheep.py +38 -0
  231. rakko_orm-1.0.0a0/tests/fields/__init__.py +4 -0
  232. rakko_orm-1.0.0a0/tests/migrations/__init__.py +5 -0
  233. rakko_orm-1.0.0a0/tests/model_setup/__init__.py +4 -0
  234. rakko_orm-1.0.0a0/tests/test_connection.py +341 -0
  235. rakko_orm-1.0.0a0/tests/test_examples.py +52 -0
  236. rakko_orm-1.0.0a0/tests/test_queryset.py +368 -0
  237. rakko_orm-1.0.0a0/tests/test_typing.py +74 -0
  238. rakko_orm-1.0.0a0/tests/test_version.py +57 -0
  239. rakko_orm-1.0.0a0/tests/testmodels.py +46 -0
  240. rakko_orm-1.0.0a0/tests/typing_queries.py +58 -0
  241. rakko_orm-1.0.0a0/tests/utils/__init__.py +4 -0
  242. rakko_orm-1.0.0a0/tests/utils/fake_client.py +98 -0
  243. rakko_orm-1.0.0a0/typings/README.md +19 -0
  244. rakko_orm-1.0.0a0/typings/pypika_tortoise-stubs/__init__.pyi +103 -0
  245. rakko_orm-1.0.0a0/typings/pypika_tortoise-stubs/py.typed +1 -0
  246. rakko_orm-1.0.0a0/uv.lock +3285 -0
@@ -0,0 +1,12 @@
1
+ <!-- Copyright (c) 2026 ropmyung (Rakko ORM modifications and additions).
2
+ Derived from Tortoise ORM; maintained and modified for Rakko ORM.
3
+ SPDX-License-Identifier: Apache-2.0 -->
4
+
5
+ # Rakko artwork
6
+
7
+ `docs/_static/rakko-logo.png` is new Rakko artwork generated with OpenAI image
8
+ generation for this project, then saved as a transparent PNG. The generation
9
+ prompt is retained in `docs/_static/rakko-logo.prompt.txt`.
10
+ It replaces the inherited project logo and does not contain Tortoise branding.
11
+ The project distributes this asset under Apache-2.0 to the extent applicable
12
+ rights permit. Generated artwork does not establish exclusive trademark rights.
@@ -0,0 +1,54 @@
1
+ .. Copyright (c) 2026 ropmyung (Rakko ORM modifications and additions).
2
+ Derived from Tortoise ORM; maintained and modified for Rakko ORM.
3
+ SPDX-License-Identifier: Apache-2.0
4
+
5
+ .. _changelog:
6
+
7
+ Rakko ORM changelog
8
+ ===================
9
+
10
+ 1.0.0-alpha — first Rakko release
11
+ ---------------------------------
12
+
13
+ Maintained by ropmyung. The Python distribution version is ``1.0.0a0``.
14
+
15
+ This file summarizes Rakko-specific changes. The project began as a fork of
16
+ `Tortoise ORM <https://github.com/tortoise/tortoise-orm>`_; upstream releases
17
+ are not presented as Rakko release history.
18
+
19
+ Model and query API
20
+ ~~~~~~~~~~~~~~~~~~~
21
+
22
+ * Require Python 3.12+ and use modern generic syntax.
23
+ * Expose class fields as ``Query[Model, Value]`` and instance fields as values.
24
+ * Replace the public ``Q``/keyword-filter pipeline with model-bound criteria
25
+ built on native ``pypika_tortoise`` expressions.
26
+ * Preserve constructor parameters through ``ParamSpec`` in query chains,
27
+ ``create``, ``update`` and both upsert methods.
28
+ * Accept field references in projections, sorting, grouping, relation loading,
29
+ bulk field lists, instance updates and refreshes. Named projections accept SQL expressions.
30
+ * Add ``@meta``/``MetaOption`` metadata and ``@reverse_relation`` accessors.
31
+
32
+ Fields and execution
33
+ ~~~~~~~~~~~~~~~~~~~~
34
+
35
+ * Separate automatic integer factories from ordinary fields; a primary key
36
+ alone no longer enables auto-increment.
37
+ * Support signed/unsigned integer sizes and MySQL UNSIGNED/AUTO_INCREMENT SQL.
38
+ * Preserve nullable Text/JSON typing, async drivers, pooling and transactions.
39
+ * Keep updates partial and upsert lookup separate from creation values;
40
+ preserve uniqueness-race retries and explicit transaction connections.
41
+ * Correct renamed-column handling in bulk conflict SQL and related partial selection.
42
+
43
+ Project and validation
44
+ ~~~~~~~~~~~~~~~~~~~~~~
45
+
46
+ * Establish Rakko's sea-otter identity and ocean-blue documentation.
47
+ * Replace inherited release notes and stale examples with concise Rakko guides.
48
+ * Add runnable examples plus runtime, SQL-generation and Pyright regression tests.
49
+
50
+ Next work
51
+ ~~~~~~~~~
52
+
53
+ An explicit JOIN builder, broader live-database validation, and adaptation of
54
+ inherited migration/integration tooling remain follow-up work.
@@ -0,0 +1,86 @@
1
+ .. Copyright (c) 2026 ropmyung (Rakko ORM modifications and additions).
2
+ Derived from Tortoise ORM; maintained and modified for Rakko ORM.
3
+ SPDX-License-Identifier: Apache-2.0
4
+
5
+ Rakko ORM acknowledgements
6
+ ==========================
7
+
8
+ Rakko is independently maintained and began as a fork of Tortoise ORM.
9
+ The original contributor list below is retained to credit upstream work.
10
+ See ``NOTICE.txt`` and ``LICENSE.txt`` for provenance and license text.
11
+
12
+ ======
13
+ Thanks
14
+ ======
15
+
16
+ Contributors
17
+ ============
18
+
19
+ * Andrey Bondar ``@abondar``
20
+ * Nickolas Grigoriadis ``@grigi``
21
+ * ``@etzelwu``
22
+ * Alexander Lyon ``@arlyon``
23
+ * Florimond Manca ``@florimondmanca``
24
+ * Vitali Rebkavets ``@REVIMI``
25
+ * Shlomy Balulu ``@shaloba``
26
+ * Klaas Nebuhr ``@FirstKlaas``
27
+ * Harsha Narayana ``@harshanarayana``
28
+ * Terra Brown ``@superloach``
29
+ * Nguyễn Hồng Quân ``@hongquan``
30
+ * Mateusz Bocian ``@mrstork``
31
+ * Vladimir Urushev ``@pilat``
32
+ * Adam Wallner ``@wallneradam``
33
+ * Zoltán Szeredi ``@zoliszeredi``
34
+ * Rebecca Klauser ``@svms1``
35
+ * Sina Sohangir ``@sinaso``
36
+ * Weiming Dong ``@dongweiming``
37
+ * ``@AEnterprise``
38
+ * Jinlong Peng ``@long2ice``
39
+ * Sang-Heon Jeon ``@lntuition``
40
+ * Jong-Yeop Park ``@pjongy``
41
+ * ``@sm0k``
42
+ * Lev Gorodetskiy ``@droserasprout``
43
+ * Hao Gong ``@dongfangtianyu``
44
+ * Peng Gao ``@Priestch``
45
+ * Mykola Solodukha ``@TrDex``
46
+ * Seo Jiyeon ``jiyeonseo``
47
+ * Blake Watters ``blakewatters``
48
+ * Alexey Tylindus ``@mirrorrim``
49
+ * Rodrigo Oliveira ``@allrod5``
50
+ * ``@SnkSynthesis``
51
+ * Alex Sinichkin ``@AlwxSin``
52
+ * ``@Yolley``
53
+ * Weiliang Li ``@kigawas``
54
+ * Bogdan Evstratenko ``@evstratbg``
55
+ * Mike Ryan ``@devsetgo``
56
+ * Eugene Dubovskoy ``@drjackild``
57
+ * Lương Quang Mạnh ``@lqmanh``
58
+ * Mykyta Holubakha ``@Hummer12007``
59
+ * Tiago Barrionuevo ``@tiabogar``
60
+ * Isaque Alves ``@isaquealves``
61
+ * Vinay Karanam ``@vinayinvicible``
62
+ * Aleksandr Rozum ``@rozumalex``
63
+ * Mojix Coder ``@MojixCoder``
64
+ * Paul Serov ``@thakryptex``
65
+ * Stanislav Zmiev ``@Ovsyanka83``
66
+ * Waket Zheng ``@waketzheng``
67
+ * Yuval Ben-Arie ``@yuvalbenarie``
68
+ * Stephan Klein ``@privatwolke``
69
+ * ``@WizzyGeek``
70
+ * Ivan Pakeev ``@ipakeev``
71
+ * Abdeldjalil Hezouat ``@Abdeldjalil-H``
72
+ * Andrea Magistà ``@vlakius``
73
+ * Daniel Szucs ``@Quasar6X``
74
+ * Rui Catarino ``@ruitcatarino``
75
+ * Lance Moe ``@lancemoe``
76
+ * Markus Beckschulte ``@markus-96``
77
+ * Frederic Aoustin ``@fraoustin``
78
+ * Ludwig Hähne ``@pankrat``
79
+ * Christian Tanul ``@scriptogre``
80
+ * Qian Chen ``@shkey``
81
+ * Varun Chawla ``@veeceey``
82
+
83
+ Special Thanks
84
+ ==============
85
+
86
+ Huge thanks to https://github.com/kayak/pypika for all heavy lifting.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2018 Andrey Bondar
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,40 @@
1
+ <!-- Copyright (c) 2026 ropmyung (Rakko ORM modifications and additions).
2
+ Derived from Tortoise ORM; maintained and modified for Rakko ORM.
3
+ SPDX-License-Identifier: Apache-2.0 -->
4
+
5
+ # Distribution license review
6
+
7
+ Reviewed for Rakko ORM 1.0.0-alpha (`1.0.0a0`), maintained by ropmyung.
8
+
9
+ Rakko is derived from Tortoise ORM and retains Apache-2.0. The review uses the
10
+ [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0), especially
11
+ sections 4 and 6, and the
12
+ [upstream license](https://github.com/tortoise/tortoise-orm/blob/develop/LICENSE.txt).
13
+
14
+ | Requirement | Distribution treatment |
15
+ | --- | --- |
16
+ | Section 4(a): include the license | The original `LICENSE.txt` is included in source and wheel distributions. |
17
+ | Section 4(b): identify modifications in modified files | Maintained source, documentation and configuration files carry Rakko modification notices. |
18
+ | Section 4(c): preserve applicable upstream attribution | Original license copyright and existing notices are retained; `CONTRIBUTORS.rst` preserves upstream acknowledgements. |
19
+ | Section 4(d): retain applicable upstream NOTICE contents, if supplied | No original NOTICE is present in this checkout. The upstream `develop` root inspected during this review lists `LICENSE.txt` and no NOTICE. Rakko's `NOTICE.txt` is explicitly identified as a new project notice. |
20
+ | Section 6: trademark rights are not granted | Separate Rakko branding is used; README and NOTICE describe the fork without implying endorsement. |
21
+
22
+ The original license SHA-256 before and after release preparation is:
23
+
24
+ ```text
25
+ f79cadf1835446bf346fc990e2986a795f00a10e811b80a4d1a20e7c50844537
26
+ ```
27
+
28
+ The checkout has no Git history identifying its exact upstream commit. Current
29
+ upstream inspection cannot establish the contents of that original snapshot;
30
+ if it is recovered and contains an applicable NOTICE or additional notices,
31
+ retain those as well. This report records the available evidence rather than
32
+ claiming a complete historical provenance audit.
33
+
34
+ Dependencies are declared separately and are not vendored into the wheel.
35
+ Their own licenses continue to apply when they are installed or redistributed;
36
+ Rakko's license does not replace them. New artwork provenance is in `ASSETS.md`.
37
+
38
+ The Apache warranty disclaimer and limitation of liability remain unchanged.
39
+ This is a record of the release's license handling, not a legal opinion or a
40
+ claim that upstream sponsors or certifies Rakko ORM.
@@ -0,0 +1,22 @@
1
+ Rakko ORM
2
+
3
+ Copyright 2018 Andrey Bondar (original Tortoise ORM).
4
+ Copyright 2026 ropmyung (Rakko ORM modifications and additions).
5
+
6
+ Rakko ORM is an independently maintained project derived from Tortoise ORM.
7
+ It includes code originally developed by Tortoise ORM contributors:
8
+ https://github.com/tortoise/tortoise-orm
9
+
10
+ Original project authors include Andrey Bondar, Nickolas Grigoriadis and
11
+ long2ice. The retained upstream contributor acknowledgements appear in
12
+ CONTRIBUTORS.rst. Existing source notices and the Apache License 2.0 text
13
+ in LICENSE.txt are retained.
14
+
15
+ Rakko-specific changes include typed model and field declarations,
16
+ model-bound PyPika expressions, query constructor parameter inference,
17
+ field-reference query APIs, explicit automatic integer fields, metadata
18
+ declarations, documentation and branding. See CHANGELOG.rst.
19
+
20
+ This notice was created for Rakko ORM; it is not an upstream NOTICE file.
21
+ Rakko ORM is not an official Tortoise ORM release and does not imply upstream
22
+ endorsement. The Apache License does not grant rights to upstream trademarks.
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: rakko-orm
3
+ Version: 1.0.0a0
4
+ Summary: An independent async Python ORM with typed fields and PyPika-powered queries
5
+ Keywords: sql,mysql,postgres,psql,sqlite,aiosqlite,asyncpg,relational,database,rdbms,orm,object mapper,async,asyncio,aio,psycopg
6
+ Author: ropmyung
7
+ License-Expression: Apache-2.0
8
+ License-File: CONTRIBUTORS.rst
9
+ License-File: LICENSE.txt
10
+ License-File: NOTICE.txt
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Programming Language :: Python :: Implementation :: CPython
18
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
19
+ Classifier: Programming Language :: PL/SQL
20
+ Classifier: Framework :: AsyncIO
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: Database
23
+ Classifier: Typing :: Typed
24
+ Classifier: Operating System :: POSIX
25
+ Classifier: Operating System :: MacOS :: MacOS X
26
+ Classifier: Operating System :: Microsoft :: Windows
27
+ Requires-Python: >=3.12
28
+ Requires-Dist: pypika-tortoise<1.0.0,>=0.6.5
29
+ Requires-Dist: iso8601<3.0.0,>=2.1.0; python_version < "4.0"
30
+ Requires-Dist: aiosqlite<1.0.0,>=0.16.0
31
+ Requires-Dist: anyio
32
+ Provides-Extra: ipython
33
+ Requires-Dist: ipython; extra == "ipython"
34
+ Requires-Dist: nest-asyncio>=1.6.0; extra == "ipython"
35
+ Provides-Extra: ptpython
36
+ Requires-Dist: ptpython>=3.0.0; extra == "ptpython"
37
+ Provides-Extra: accel
38
+ Requires-Dist: ciso8601; sys_platform != "win32" and implementation_name == "cpython" and extra == "accel"
39
+ Requires-Dist: uvloop; sys_platform != "win32" and implementation_name == "cpython" and extra == "accel"
40
+ Requires-Dist: orjson; extra == "accel"
41
+ Provides-Extra: asyncpg
42
+ Requires-Dist: asyncpg; extra == "asyncpg"
43
+ Provides-Extra: aiomysql
44
+ Requires-Dist: aiomysql; extra == "aiomysql"
45
+ Provides-Extra: asyncmy
46
+ Requires-Dist: asyncmy<1.0.0,>=0.2.12; extra == "asyncmy"
47
+ Provides-Extra: psycopg
48
+ Requires-Dist: psycopg[binary,pool]<4.0.0,>=3.0.12; extra == "psycopg"
49
+ Provides-Extra: asyncodbc
50
+ Requires-Dist: asyncodbc<1.0.0,>=0.1.1; python_version < "4.0" and extra == "asyncodbc"
51
+ Description-Content-Type: text/markdown
52
+
53
+ <!-- Copyright (c) 2026 ropmyung (Rakko ORM modifications and additions).
54
+ Derived from Tortoise ORM; maintained and modified for Rakko ORM.
55
+ SPDX-License-Identifier: Apache-2.0 -->
56
+
57
+ # Rakko ORM
58
+
59
+ **Typed queries. Async by nature.**
60
+
61
+ Rakko ORM is an independent asynchronous Python ORM maintained by **ropmyung**.
62
+ Release **1.0.0-alpha** uses the Python package version **1.0.0a0** and requires
63
+ Python **3.12 or newer**. Its name means sea otter (해달).
64
+
65
+ Rakko began as a fork of [Tortoise ORM](https://github.com/tortoise/tortoise-orm).
66
+ It retains the async database foundation while redesigning field typing,
67
+ model metadata and query composition. It is developed as a separate project.
68
+
69
+ ```python
70
+ import asyncio
71
+
72
+ from rakko import Field, Model, fields
73
+ from rakko.context import TortoiseContext
74
+
75
+
76
+ class User(Model):
77
+ id: Field[int] = fields.AutoField()
78
+ name: Field[str] = fields.CharField(100)
79
+ age: Field[int | None] = fields.IntField(null=True)
80
+
81
+
82
+ async def main() -> None:
83
+ async with TortoiseContext() as context:
84
+ await context.init(db_url="sqlite://:memory:", modules={"models": [__name__]})
85
+ await context.generate_schemas()
86
+ user = await User.create(name="Ada", age=20)
87
+ await User.filter(User.id == user.id).update(age=21)
88
+ print(await User.filter(User.age >= 18).values(User.name, User.age))
89
+
90
+
91
+ if __name__ == "__main__":
92
+ asyncio.run(main())
93
+ ```
94
+
95
+ - Class fields are model-bound query expressions; instance fields are Python values.
96
+ - Conditions use Python comparisons and `&`, `|`, `~`; filtering takes one criterion.
97
+ - Projections, sorting, grouping and relation loading accept field references.
98
+ - `ParamSpec` preserves model constructor names and types through query chains and upserts.
99
+ - Automatic integer fields are explicit; setting a primary key alone does not enable auto-increment.
100
+ - MySQL signed/unsigned integers, async drivers, connection pools and transactions are retained.
101
+
102
+ Ordinary constructor parameters are optional in static signatures; runtime
103
+ validation and database constraints still apply. Updates modify supplied fields.
104
+ SQL expressions use `pypika_tortoise`. An explicit JOIN builder and adaptation
105
+ of inherited migration/integration tooling remain future work.
106
+
107
+ SQLite works with the base package. MySQL drivers are available through the
108
+ `aiomysql` and `asyncmy` extras. PostgreSQL drivers use `asyncpg` or `psycopg`.
109
+ The source distribution includes documentation sources, examples and tests.
110
+
111
+ Rakko ORM is distributed under the
112
+ [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).
113
+ `LICENSE.txt`, `NOTICE.txt` and `CONTRIBUTORS.rst` accompany distributions and
114
+ preserve upstream licensing and credits. No upstream endorsement is implied.
@@ -0,0 +1,125 @@
1
+ <!-- Copyright (c) 2026 ropmyung (Rakko ORM modifications and additions).
2
+ Derived from Tortoise ORM; maintained and modified for Rakko ORM.
3
+ SPDX-License-Identifier: Apache-2.0 -->
4
+
5
+ <p align="center">
6
+ <img src="docs/_static/rakko-logo.png" width="160" height="160" alt="Rakko ORM — a sea otter in an ocean wave">
7
+ </p>
8
+
9
+ # Rakko ORM
10
+
11
+ **Typed queries. Async by nature.**
12
+
13
+ **1.0.0-alpha** · Python package version **1.0.0a0** · Maintained by **ropmyung**.
14
+
15
+ Rakko ORM is an asynchronous Python ORM built around typed model fields,
16
+ natural Python conditions and MySQL-friendly database access.
17
+ Its name comes from *rakko*, the Japanese word for sea otter (해달).
18
+
19
+ ```python
20
+ members = await Member.filter(
21
+ (Member.age >= 18) & (Member.guild == guild)
22
+ ).order_by(-Member.age).values(Member.name, Member.age)
23
+ ```
24
+
25
+ Rakko began as a fork of [Tortoise ORM](https://github.com/tortoise/tortoise-orm).
26
+ It is now developed as a separate project with its own package, API direction,
27
+ documentation and identity. Tortoise's async database foundation is retained;
28
+ Rakko redesigns model typing, field declarations and query composition.
29
+
30
+ ## What changes
31
+
32
+ - **Fields with two views:** `Member.age` is a typed query expression; `member.age` is a Python value.
33
+ - **Python conditions:** combine comparisons with `&`, `|` and `~`, then pass one model-bound `Criterion`.
34
+ - **Field references throughout:** projections, ordering, grouping, relations and bulk field lists use model attributes.
35
+ - **Constructor-aware calls:** `ParamSpec` preserves model parameter names and value types through query chains and upserts.
36
+ - **Explicit automatic integers:** `AutoField`, `BigAutoField`, `SmallAutoField` and `TinyAutoField` are separate from ordinary integers. A primary key alone does not enable auto-increment.
37
+ - **MySQL support:** async drivers, pooling, transactions and signed/unsigned integer fields.
38
+ - **Model metadata and reverse accessors:** `@meta`, `MetaOption` and `@reverse_relation` provide explicit declarations.
39
+
40
+ SQL construction uses `pypika_tortoise`; database connections and transaction
41
+ management build on the existing async backend adapters.
42
+
43
+ ## Try this checkout
44
+
45
+ Python **3.12 or newer** is required. These commands install and run the local
46
+ project; they do not assume that a Rakko release is available on PyPI.
47
+
48
+ ```powershell
49
+ uv sync --group test
50
+ uv run -m examples.basic
51
+ uv run -m examples.queries
52
+ uv run -m examples.relations
53
+ uv run -m examples.bulk_and_transactions
54
+ ```
55
+
56
+ The examples use isolated in-memory SQLite databases. To preview MySQL SQL,
57
+ including UNSIGNED and AUTO_INCREMENT, without connecting to a server:
58
+
59
+ ```powershell
60
+ uv run --extra aiomysql -m examples.mysql_sql
61
+ ```
62
+
63
+ ## A small application
64
+
65
+ ```python
66
+ import asyncio
67
+
68
+ from rakko import Field, Model, fields
69
+ from rakko.context import TortoiseContext
70
+
71
+
72
+ class User(Model):
73
+ id: Field[int] = fields.AutoField()
74
+ name: Field[str] = fields.CharField(100)
75
+ age: Field[int | None] = fields.IntField(null=True)
76
+
77
+
78
+ async def main() -> None:
79
+ async with TortoiseContext() as context:
80
+ await context.init(db_url="sqlite://:memory:", modules={"models": [__name__]})
81
+ await context.generate_schemas()
82
+
83
+ user = await User.create(name="Ada")
84
+ await User.filter(User.id == user.id).update(age=21)
85
+ print(await User.all().values(User.name, User.age))
86
+
87
+
88
+ if __name__ == "__main__":
89
+ asyncio.run(main())
90
+ ```
91
+
92
+ Ordinary model parameters are optional in static constructor signatures while
93
+ field names and value types remain checked. Runtime validation and database
94
+ constraints still determine whether a record can be saved. Updates change only
95
+ the explicitly supplied fields. `create`, `get_or_create` and `update_or_create`
96
+ accept model arguments directly; upsert criteria are used only for lookup.
97
+
98
+ ## Read and contribute
99
+
100
+ - [Getting started](docs/getting_started.rst)
101
+ - [Model and field declarations](docs/models.rst)
102
+ - [Query API](docs/query.rst)
103
+ - [Changes from Tortoise ORM](docs/migration_guide.rst)
104
+ - [Runnable examples](examples/README.md)
105
+ - [Development and contribution guide](docs/CONTRIBUTING.rst)
106
+ - [Concise changelog](CHANGELOG.rst)
107
+ - [Release preparation and publishing](RELEASING.md)
108
+ - [License review](LICENSE_REVIEW.md)
109
+
110
+ ```powershell
111
+ uv run --all-groups --extra asyncpg --extra psycopg pytest -q
112
+ uv run --group docs sphinx-build -W --keep-going -b html docs docs/_build/html
113
+ ```
114
+
115
+ The test suite exercises SQLite execution, generated MySQL/PostgreSQL SQL and
116
+ Pyright typing contracts. The migration framework and additional integrations
117
+ are retained from the original codebase and are still being adapted to Rakko's API.
118
+
119
+ ## Origins and license
120
+
121
+ Rakko ORM is distributed under [Apache License 2.0](LICENSE.txt).
122
+ The original [Tortoise ORM](https://github.com/tortoise/tortoise-orm) authors and
123
+ contributors are acknowledged in [NOTICE.txt](NOTICE.txt) and
124
+ [CONTRIBUTORS.rst](CONTRIBUTORS.rst). Upstream release history is separate from
125
+ [Rakko's changelog](CHANGELOG.rst).