alchemiq 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 (388) hide show
  1. alchemiq-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +34 -0
  2. alchemiq-0.1.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  3. alchemiq-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
  4. alchemiq-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +17 -0
  5. alchemiq-0.1.0/.github/workflows/ci.yml +100 -0
  6. alchemiq-0.1.0/.github/workflows/release.yml +29 -0
  7. alchemiq-0.1.0/.gitignore +24 -0
  8. alchemiq-0.1.0/.python-version +1 -0
  9. alchemiq-0.1.0/.readthedocs.yaml +10 -0
  10. alchemiq-0.1.0/CHANGELOG.md +89 -0
  11. alchemiq-0.1.0/CODE_OF_CONDUCT.md +132 -0
  12. alchemiq-0.1.0/CONTRIBUTING.md +81 -0
  13. alchemiq-0.1.0/LICENSE +21 -0
  14. alchemiq-0.1.0/MAINTAINING.md +125 -0
  15. alchemiq-0.1.0/PKG-INFO +170 -0
  16. alchemiq-0.1.0/README.md +102 -0
  17. alchemiq-0.1.0/SECURITY.md +29 -0
  18. alchemiq-0.1.0/docs/conf.py +45 -0
  19. alchemiq-0.1.0/docs/guide/caching.md +128 -0
  20. alchemiq-0.1.0/docs/guide/clickhouse.md +242 -0
  21. alchemiq-0.1.0/docs/guide/custom-field-types.md +83 -0
  22. alchemiq-0.1.0/docs/guide/fastapi.md +174 -0
  23. alchemiq-0.1.0/docs/guide/getting-started.md +78 -0
  24. alchemiq-0.1.0/docs/guide/health.md +157 -0
  25. alchemiq-0.1.0/docs/guide/migrations.md +157 -0
  26. alchemiq-0.1.0/docs/guide/models-and-fields.md +264 -0
  27. alchemiq-0.1.0/docs/guide/native-columns.md +110 -0
  28. alchemiq-0.1.0/docs/guide/optimistic-locking.md +94 -0
  29. alchemiq-0.1.0/docs/guide/outbox-and-relay.md +210 -0
  30. alchemiq-0.1.0/docs/guide/queries.md +217 -0
  31. alchemiq-0.1.0/docs/guide/relationships.md +157 -0
  32. alchemiq-0.1.0/docs/guide/repository.md +295 -0
  33. alchemiq-0.1.0/docs/guide/scaffolding.md +206 -0
  34. alchemiq-0.1.0/docs/guide/serialization.md +128 -0
  35. alchemiq-0.1.0/docs/guide/signals.md +98 -0
  36. alchemiq-0.1.0/docs/guide/soft-delete.md +173 -0
  37. alchemiq-0.1.0/docs/guide/unit-of-work.md +120 -0
  38. alchemiq-0.1.0/docs/guide/whats-not-in-v1.md +159 -0
  39. alchemiq-0.1.0/docs/index.md +86 -0
  40. alchemiq-0.1.0/docs/reference/caching.rst +11 -0
  41. alchemiq-0.1.0/docs/reference/clickhouse.rst +5 -0
  42. alchemiq-0.1.0/docs/reference/exceptions.rst +39 -0
  43. alchemiq-0.1.0/docs/reference/fastapi.rst +5 -0
  44. alchemiq-0.1.0/docs/reference/faststream.rst +5 -0
  45. alchemiq-0.1.0/docs/reference/health.rst +8 -0
  46. alchemiq-0.1.0/docs/reference/index.rst +18 -0
  47. alchemiq-0.1.0/docs/reference/migrations.rst +5 -0
  48. alchemiq-0.1.0/docs/reference/models.rst +16 -0
  49. alchemiq-0.1.0/docs/reference/outbox.rst +17 -0
  50. alchemiq-0.1.0/docs/reference/query.rst +20 -0
  51. alchemiq-0.1.0/docs/reference/repository.rst +9 -0
  52. alchemiq-0.1.0/docs/reference/runtime.rst +17 -0
  53. alchemiq-0.1.0/pyproject.toml +156 -0
  54. alchemiq-0.1.0/src/alchemiq/__init__.py +67 -0
  55. alchemiq-0.1.0/src/alchemiq/_internal/__init__.py +0 -0
  56. alchemiq-0.1.0/src/alchemiq/_internal/annotations.py +105 -0
  57. alchemiq-0.1.0/src/alchemiq/_internal/crypto.py +48 -0
  58. alchemiq-0.1.0/src/alchemiq/_internal/hashing.py +150 -0
  59. alchemiq-0.1.0/src/alchemiq/_internal/ids.py +51 -0
  60. alchemiq-0.1.0/src/alchemiq/_internal/wire.py +48 -0
  61. alchemiq-0.1.0/src/alchemiq/cache/__init__.py +17 -0
  62. alchemiq-0.1.0/src/alchemiq/cache/backend.py +113 -0
  63. alchemiq-0.1.0/src/alchemiq/cache/keys.py +57 -0
  64. alchemiq-0.1.0/src/alchemiq/cache/memory.py +63 -0
  65. alchemiq-0.1.0/src/alchemiq/cache/ops.py +144 -0
  66. alchemiq-0.1.0/src/alchemiq/cache/redis.py +55 -0
  67. alchemiq-0.1.0/src/alchemiq/cache/serialize.py +66 -0
  68. alchemiq-0.1.0/src/alchemiq/cli.py +17 -0
  69. alchemiq-0.1.0/src/alchemiq/clickhouse/__init__.py +64 -0
  70. alchemiq-0.1.0/src/alchemiq/clickhouse/connection.py +112 -0
  71. alchemiq-0.1.0/src/alchemiq/clickhouse/ddl.py +86 -0
  72. alchemiq-0.1.0/src/alchemiq/clickhouse/engines.py +110 -0
  73. alchemiq-0.1.0/src/alchemiq/clickhouse/model.py +250 -0
  74. alchemiq-0.1.0/src/alchemiq/clickhouse/publisher.py +58 -0
  75. alchemiq-0.1.0/src/alchemiq/clickhouse/query.py +257 -0
  76. alchemiq-0.1.0/src/alchemiq/clickhouse/registry.py +15 -0
  77. alchemiq-0.1.0/src/alchemiq/clickhouse/repository.py +534 -0
  78. alchemiq-0.1.0/src/alchemiq/clickhouse/types.py +183 -0
  79. alchemiq-0.1.0/src/alchemiq/exceptions.py +108 -0
  80. alchemiq-0.1.0/src/alchemiq/fastapi/__init__.py +37 -0
  81. alchemiq-0.1.0/src/alchemiq/fastapi/deps.py +16 -0
  82. alchemiq-0.1.0/src/alchemiq/fastapi/errors.py +87 -0
  83. alchemiq-0.1.0/src/alchemiq/fastapi/health.py +56 -0
  84. alchemiq-0.1.0/src/alchemiq/fastapi/lifespan.py +53 -0
  85. alchemiq-0.1.0/src/alchemiq/fastapi/router.py +230 -0
  86. alchemiq-0.1.0/src/alchemiq/fastapi/schemas.py +165 -0
  87. alchemiq-0.1.0/src/alchemiq/faststream/__init__.py +13 -0
  88. alchemiq-0.1.0/src/alchemiq/faststream/deps.py +11 -0
  89. alchemiq-0.1.0/src/alchemiq/faststream/lifespan.py +56 -0
  90. alchemiq-0.1.0/src/alchemiq/faststream/publisher.py +92 -0
  91. alchemiq-0.1.0/src/alchemiq/health/__init__.py +6 -0
  92. alchemiq-0.1.0/src/alchemiq/health/checks.py +115 -0
  93. alchemiq-0.1.0/src/alchemiq/health/report.py +54 -0
  94. alchemiq-0.1.0/src/alchemiq/migrations/__init__.py +12 -0
  95. alchemiq-0.1.0/src/alchemiq/migrations/cli.py +223 -0
  96. alchemiq-0.1.0/src/alchemiq/migrations/clickhouse/__init__.py +3 -0
  97. alchemiq-0.1.0/src/alchemiq/migrations/clickhouse/autogen.py +96 -0
  98. alchemiq-0.1.0/src/alchemiq/migrations/clickhouse/history.py +37 -0
  99. alchemiq-0.1.0/src/alchemiq/migrations/clickhouse/introspect.py +34 -0
  100. alchemiq-0.1.0/src/alchemiq/migrations/clickhouse/migration.py +20 -0
  101. alchemiq-0.1.0/src/alchemiq/migrations/clickhouse/operations.py +196 -0
  102. alchemiq-0.1.0/src/alchemiq/migrations/clickhouse/render.py +73 -0
  103. alchemiq-0.1.0/src/alchemiq/migrations/clickhouse/runner.py +232 -0
  104. alchemiq-0.1.0/src/alchemiq/migrations/config.py +182 -0
  105. alchemiq-0.1.0/src/alchemiq/migrations/errors.py +13 -0
  106. alchemiq-0.1.0/src/alchemiq/migrations/postgres/__init__.py +3 -0
  107. alchemiq-0.1.0/src/alchemiq/migrations/postgres/_template/env.py +54 -0
  108. alchemiq-0.1.0/src/alchemiq/migrations/postgres/_template/script.py.mako +22 -0
  109. alchemiq-0.1.0/src/alchemiq/migrations/postgres/backend.py +87 -0
  110. alchemiq-0.1.0/src/alchemiq/migrations/postgres/render.py +30 -0
  111. alchemiq-0.1.0/src/alchemiq/model/__init__.py +5 -0
  112. alchemiq-0.1.0/src/alchemiq/model/base.py +265 -0
  113. alchemiq-0.1.0/src/alchemiq/model/meta_options.py +124 -0
  114. alchemiq-0.1.0/src/alchemiq/model/pipeline.py +317 -0
  115. alchemiq-0.1.0/src/alchemiq/model/registry.py +9 -0
  116. alchemiq-0.1.0/src/alchemiq/model/relationships.py +361 -0
  117. alchemiq-0.1.0/src/alchemiq/model/serialization.py +171 -0
  118. alchemiq-0.1.0/src/alchemiq/outbox/__init__.py +22 -0
  119. alchemiq-0.1.0/src/alchemiq/outbox/capture.py +60 -0
  120. alchemiq-0.1.0/src/alchemiq/outbox/message.py +46 -0
  121. alchemiq-0.1.0/src/alchemiq/outbox/models.py +43 -0
  122. alchemiq-0.1.0/src/alchemiq/outbox/publisher.py +62 -0
  123. alchemiq-0.1.0/src/alchemiq/outbox/relay.py +181 -0
  124. alchemiq-0.1.0/src/alchemiq/outbox/status.py +8 -0
  125. alchemiq-0.1.0/src/alchemiq/outbox/store.py +66 -0
  126. alchemiq-0.1.0/src/alchemiq/outbox/taskiq.py +40 -0
  127. alchemiq-0.1.0/src/alchemiq/py.typed +0 -0
  128. alchemiq-0.1.0/src/alchemiq/query/__init__.py +7 -0
  129. alchemiq-0.1.0/src/alchemiq/query/aggregates.py +87 -0
  130. alchemiq-0.1.0/src/alchemiq/query/compiler.py +196 -0
  131. alchemiq-0.1.0/src/alchemiq/query/cursor.py +89 -0
  132. alchemiq-0.1.0/src/alchemiq/query/explain.py +34 -0
  133. alchemiq-0.1.0/src/alchemiq/query/lookups.py +79 -0
  134. alchemiq-0.1.0/src/alchemiq/query/q.py +145 -0
  135. alchemiq-0.1.0/src/alchemiq/query/queryset.py +685 -0
  136. alchemiq-0.1.0/src/alchemiq/query/serialize.py +171 -0
  137. alchemiq-0.1.0/src/alchemiq/query/soft_delete.py +56 -0
  138. alchemiq-0.1.0/src/alchemiq/repository/__init__.py +6 -0
  139. alchemiq-0.1.0/src/alchemiq/repository/base.py +736 -0
  140. alchemiq-0.1.0/src/alchemiq/repository/loading.py +42 -0
  141. alchemiq-0.1.0/src/alchemiq/repository/pagination.py +47 -0
  142. alchemiq-0.1.0/src/alchemiq/repository/upsert.py +78 -0
  143. alchemiq-0.1.0/src/alchemiq/runtime/__init__.py +6 -0
  144. alchemiq-0.1.0/src/alchemiq/runtime/engine.py +95 -0
  145. alchemiq-0.1.0/src/alchemiq/runtime/post_commit.py +52 -0
  146. alchemiq-0.1.0/src/alchemiq/runtime/providers.py +43 -0
  147. alchemiq-0.1.0/src/alchemiq/runtime/session.py +42 -0
  148. alchemiq-0.1.0/src/alchemiq/runtime/soft_delete_filter.py +68 -0
  149. alchemiq-0.1.0/src/alchemiq/runtime/unit_of_work.py +140 -0
  150. alchemiq-0.1.0/src/alchemiq/scaffold/__init__.py +1 -0
  151. alchemiq-0.1.0/src/alchemiq/scaffold/cli.py +79 -0
  152. alchemiq-0.1.0/src/alchemiq/scaffold/options.py +157 -0
  153. alchemiq-0.1.0/src/alchemiq/scaffold/plan.py +215 -0
  154. alchemiq-0.1.0/src/alchemiq/scaffold/render.py +27 -0
  155. alchemiq-0.1.0/src/alchemiq/scaffold/templates/monorepo_root/.env.example.tmpl +20 -0
  156. alchemiq-0.1.0/src/alchemiq/scaffold/templates/monorepo_root/.gitignore.tmpl +9 -0
  157. alchemiq-0.1.0/src/alchemiq/scaffold/templates/monorepo_root/README.md.tmpl +35 -0
  158. alchemiq-0.1.0/src/alchemiq/scaffold/templates/monorepo_root/docker/postgres-init.sh.tmpl +9 -0
  159. alchemiq-0.1.0/src/alchemiq/scaffold/templates/monorepo_root/docker-compose.yml.tmpl +49 -0
  160. alchemiq-0.1.0/src/alchemiq/scaffold/templates/monorepo_root/packages/shared/pyproject.toml.tmpl +12 -0
  161. alchemiq-0.1.0/src/alchemiq/scaffold/templates/monorepo_root/packages/shared/src/shared/__init__.py.tmpl +22 -0
  162. alchemiq-0.1.0/src/alchemiq/scaffold/templates/monorepo_root/pyproject.toml.tmpl +18 -0
  163. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/.dockerignore.tmpl +14 -0
  164. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/.env.example.tmpl +19 -0
  165. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/.gitignore.tmpl +9 -0
  166. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/Dockerfile.tmpl +31 -0
  167. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/README.md.tmpl +40 -0
  168. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/docker-compose.yml.tmpl +47 -0
  169. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/pyproject.toml.tmpl +53 -0
  170. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/__init__.py.tmpl +1 -0
  171. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/adapters/__init__.py.tmpl +6 -0
  172. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/adapters/http/__init__.py.tmpl +19 -0
  173. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/adapters/messaging/__init__.py.tmpl +21 -0
  174. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/app.py.tmpl +25 -0
  175. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/app_clickhouse.py.tmpl +39 -0
  176. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/broker.py.tmpl +20 -0
  177. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/broker_clickhouse.py.tmpl +36 -0
  178. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/config.py.tmpl +44 -0
  179. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/domain/__init__.py.tmpl +6 -0
  180. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/domain/models.py.tmpl +50 -0
  181. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/domain/models_clickhouse.py.tmpl +28 -0
  182. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/repositories/__init__.py.tmpl +17 -0
  183. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/services/__init__.py.tmpl +19 -0
  184. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/src/__ALCHEMIQ_MODULE__/use_cases/__init__.py.tmpl +25 -0
  185. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/tests/conftest.py.tmpl +35 -0
  186. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/tests/conftest_clickhouse.py.tmpl +46 -0
  187. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/tests/test_models.py.tmpl +22 -0
  188. alchemiq-0.1.0/src/alchemiq/scaffold/templates/single/tests/test_models_clickhouse.py.tmpl +17 -0
  189. alchemiq-0.1.0/src/alchemiq/signals/__init__.py +73 -0
  190. alchemiq-0.1.0/src/alchemiq/signals/registry.py +37 -0
  191. alchemiq-0.1.0/src/alchemiq/types/__init__.py +57 -0
  192. alchemiq-0.1.0/src/alchemiq/types/base.py +158 -0
  193. alchemiq-0.1.0/src/alchemiq/types/maybe.py +264 -0
  194. alchemiq-0.1.0/src/alchemiq/types/numeric.py +165 -0
  195. alchemiq-0.1.0/src/alchemiq/types/pk.py +83 -0
  196. alchemiq-0.1.0/src/alchemiq/types/special.py +152 -0
  197. alchemiq-0.1.0/src/alchemiq/types/strings.py +206 -0
  198. alchemiq-0.1.0/src/alchemiq/types/temporal.py +132 -0
  199. alchemiq-0.1.0/tests/__init__.py +0 -0
  200. alchemiq-0.1.0/tests/clickhouse/__init__.py +0 -0
  201. alchemiq-0.1.0/tests/clickhouse/test_buffered.py +105 -0
  202. alchemiq-0.1.0/tests/clickhouse/test_connection.py +67 -0
  203. alchemiq-0.1.0/tests/clickhouse/test_coverage_gaps.py +361 -0
  204. alchemiq-0.1.0/tests/clickhouse/test_ddl.py +34 -0
  205. alchemiq-0.1.0/tests/clickhouse/test_ddl_integration.py +23 -0
  206. alchemiq-0.1.0/tests/clickhouse/test_engines.py +45 -0
  207. alchemiq-0.1.0/tests/clickhouse/test_exports.py +45 -0
  208. alchemiq-0.1.0/tests/clickhouse/test_health_integration.py +15 -0
  209. alchemiq-0.1.0/tests/clickhouse/test_import_guard.py +17 -0
  210. alchemiq-0.1.0/tests/clickhouse/test_migrations_ch_runner.py +120 -0
  211. alchemiq-0.1.0/tests/clickhouse/test_model.py +137 -0
  212. alchemiq-0.1.0/tests/clickhouse/test_publisher.py +55 -0
  213. alchemiq-0.1.0/tests/clickhouse/test_publisher_integration.py +43 -0
  214. alchemiq-0.1.0/tests/clickhouse/test_query_render.py +67 -0
  215. alchemiq-0.1.0/tests/clickhouse/test_query_terminals.py +73 -0
  216. alchemiq-0.1.0/tests/clickhouse/test_repository_insert.py +21 -0
  217. alchemiq-0.1.0/tests/clickhouse/test_repository_reads.py +105 -0
  218. alchemiq-0.1.0/tests/clickhouse/test_repository_unsupported.py +41 -0
  219. alchemiq-0.1.0/tests/clickhouse/test_soft_delete.py +224 -0
  220. alchemiq-0.1.0/tests/clickhouse/test_types.py +85 -0
  221. alchemiq-0.1.0/tests/conftest.py +142 -0
  222. alchemiq-0.1.0/tests/integration/__init__.py +0 -0
  223. alchemiq-0.1.0/tests/integration/_migration_models.py +10 -0
  224. alchemiq-0.1.0/tests/integration/test_aggregate.py +71 -0
  225. alchemiq-0.1.0/tests/integration/test_bulk_upsert.py +61 -0
  226. alchemiq-0.1.0/tests/integration/test_cache_invalidation.py +98 -0
  227. alchemiq-0.1.0/tests/integration/test_cache_reads.py +43 -0
  228. alchemiq-0.1.0/tests/integration/test_cache_redis_e2e.py +33 -0
  229. alchemiq-0.1.0/tests/integration/test_cursor_paginate.py +148 -0
  230. alchemiq-0.1.0/tests/integration/test_ddl_roundtrip.py +233 -0
  231. alchemiq-0.1.0/tests/integration/test_explain.py +46 -0
  232. alchemiq-0.1.0/tests/integration/test_fastapi_cursor.py +61 -0
  233. alchemiq-0.1.0/tests/integration/test_fastapi_end_to_end.py +90 -0
  234. alchemiq-0.1.0/tests/integration/test_fastapi_lifespan.py +38 -0
  235. alchemiq-0.1.0/tests/integration/test_fastapi_router_read.py +72 -0
  236. alchemiq-0.1.0/tests/integration/test_fastapi_router_write.py +92 -0
  237. alchemiq-0.1.0/tests/integration/test_faststream_end_to_end.py +71 -0
  238. alchemiq-0.1.0/tests/integration/test_health_integration.py +41 -0
  239. alchemiq-0.1.0/tests/integration/test_health_routes_e2e.py +32 -0
  240. alchemiq-0.1.0/tests/integration/test_mass_ops.py +78 -0
  241. alchemiq-0.1.0/tests/integration/test_migrations_cli_e2e.py +43 -0
  242. alchemiq-0.1.0/tests/integration/test_migrations_pg.py +95 -0
  243. alchemiq-0.1.0/tests/integration/test_native_interop.py +76 -0
  244. alchemiq-0.1.0/tests/integration/test_native_relationship.py +55 -0
  245. alchemiq-0.1.0/tests/integration/test_optimistic_lock.py +183 -0
  246. alchemiq-0.1.0/tests/integration/test_outbox_atomicity.py +47 -0
  247. alchemiq-0.1.0/tests/integration/test_outbox_capture.py +153 -0
  248. alchemiq-0.1.0/tests/integration/test_outbox_publish.py +44 -0
  249. alchemiq-0.1.0/tests/integration/test_outbox_relay.py +46 -0
  250. alchemiq-0.1.0/tests/integration/test_outbox_relay_concurrency.py +32 -0
  251. alchemiq-0.1.0/tests/integration/test_outbox_relay_failures.py +153 -0
  252. alchemiq-0.1.0/tests/integration/test_paginate.py +42 -0
  253. alchemiq-0.1.0/tests/integration/test_post_commit_timing.py +51 -0
  254. alchemiq-0.1.0/tests/integration/test_queries.py +164 -0
  255. alchemiq-0.1.0/tests/integration/test_queryset_get.py +98 -0
  256. alchemiq-0.1.0/tests/integration/test_queryset_terminals.py +56 -0
  257. alchemiq-0.1.0/tests/integration/test_relation_not_loaded.py +33 -0
  258. alchemiq-0.1.0/tests/integration/test_relationships_m2m.py +50 -0
  259. alchemiq-0.1.0/tests/integration/test_relationships_o2o.py +53 -0
  260. alchemiq-0.1.0/tests/integration/test_repository_read.py +31 -0
  261. alchemiq-0.1.0/tests/integration/test_repository_upsert.py +36 -0
  262. alchemiq-0.1.0/tests/integration/test_repository_write.py +60 -0
  263. alchemiq-0.1.0/tests/integration/test_scaffold_render_clickhouse.py +74 -0
  264. alchemiq-0.1.0/tests/integration/test_scaffold_render_monorepo.py +73 -0
  265. alchemiq-0.1.0/tests/integration/test_scaffold_render_single.py +139 -0
  266. alchemiq-0.1.0/tests/integration/test_select_prefetch.py +51 -0
  267. alchemiq-0.1.0/tests/integration/test_serialization_relations.py +51 -0
  268. alchemiq-0.1.0/tests/integration/test_session_scope_pg.py +22 -0
  269. alchemiq-0.1.0/tests/integration/test_signals.py +69 -0
  270. alchemiq-0.1.0/tests/integration/test_soft_delete.py +85 -0
  271. alchemiq-0.1.0/tests/integration/test_soft_delete_mass.py +73 -0
  272. alchemiq-0.1.0/tests/integration/test_soft_delete_relations.py +106 -0
  273. alchemiq-0.1.0/tests/integration/test_unit_of_work.py +79 -0
  274. alchemiq-0.1.0/tests/typing/__init__.py +0 -0
  275. alchemiq-0.1.0/tests/typing/models.py +117 -0
  276. alchemiq-0.1.0/tests/typing/pyrightconfig.json +5 -0
  277. alchemiq-0.1.0/tests/typing/test_typing_acceptance.py +26 -0
  278. alchemiq-0.1.0/tests/unit/__init__.py +0 -0
  279. alchemiq-0.1.0/tests/unit/_cache_models.py +12 -0
  280. alchemiq-0.1.0/tests/unit/test_aggregates.py +47 -0
  281. alchemiq-0.1.0/tests/unit/test_annotations.py +43 -0
  282. alchemiq-0.1.0/tests/unit/test_cache_backend.py +84 -0
  283. alchemiq-0.1.0/tests/unit/test_cache_import_isolation.py +76 -0
  284. alchemiq-0.1.0/tests/unit/test_cache_keys.py +46 -0
  285. alchemiq-0.1.0/tests/unit/test_cache_ops.py +148 -0
  286. alchemiq-0.1.0/tests/unit/test_cache_queryset.py +31 -0
  287. alchemiq-0.1.0/tests/unit/test_cache_repository.py +49 -0
  288. alchemiq-0.1.0/tests/unit/test_cache_serialize.py +37 -0
  289. alchemiq-0.1.0/tests/unit/test_cli_dispatch.py +48 -0
  290. alchemiq-0.1.0/tests/unit/test_compile_q.py +58 -0
  291. alchemiq-0.1.0/tests/unit/test_compile_traversal.py +85 -0
  292. alchemiq-0.1.0/tests/unit/test_cursor.py +66 -0
  293. alchemiq-0.1.0/tests/unit/test_engine_config.py +42 -0
  294. alchemiq-0.1.0/tests/unit/test_exceptions.py +30 -0
  295. alchemiq-0.1.0/tests/unit/test_explain.py +39 -0
  296. alchemiq-0.1.0/tests/unit/test_fastapi_deps.py +42 -0
  297. alchemiq-0.1.0/tests/unit/test_fastapi_errors.py +64 -0
  298. alchemiq-0.1.0/tests/unit/test_fastapi_import_isolation.py +24 -0
  299. alchemiq-0.1.0/tests/unit/test_fastapi_public_surface.py +39 -0
  300. alchemiq-0.1.0/tests/unit/test_fastapi_router_config.py +41 -0
  301. alchemiq-0.1.0/tests/unit/test_fastapi_schemas.py +85 -0
  302. alchemiq-0.1.0/tests/unit/test_faststream_import_isolation.py +22 -0
  303. alchemiq-0.1.0/tests/unit/test_faststream_lifespan.py +26 -0
  304. alchemiq-0.1.0/tests/unit/test_faststream_public_surface.py +27 -0
  305. alchemiq-0.1.0/tests/unit/test_faststream_publisher.py +89 -0
  306. alchemiq-0.1.0/tests/unit/test_field_base.py +33 -0
  307. alchemiq-0.1.0/tests/unit/test_field_descriptor.py +55 -0
  308. alchemiq-0.1.0/tests/unit/test_health_check.py +146 -0
  309. alchemiq-0.1.0/tests/unit/test_health_import_isolation.py +35 -0
  310. alchemiq-0.1.0/tests/unit/test_health_public_api.py +18 -0
  311. alchemiq-0.1.0/tests/unit/test_health_report.py +54 -0
  312. alchemiq-0.1.0/tests/unit/test_health_routes.py +63 -0
  313. alchemiq-0.1.0/tests/unit/test_loading_options.py +39 -0
  314. alchemiq-0.1.0/tests/unit/test_lookups.py +80 -0
  315. alchemiq-0.1.0/tests/unit/test_mapping.py +36 -0
  316. alchemiq-0.1.0/tests/unit/test_mass_ops_traversal.py +31 -0
  317. alchemiq-0.1.0/tests/unit/test_maybe.py +93 -0
  318. alchemiq-0.1.0/tests/unit/test_maybe_field.py +180 -0
  319. alchemiq-0.1.0/tests/unit/test_maybe_match.py +27 -0
  320. alchemiq-0.1.0/tests/unit/test_meta_materialize.py +49 -0
  321. alchemiq-0.1.0/tests/unit/test_meta_options.py +62 -0
  322. alchemiq-0.1.0/tests/unit/test_migrations_ch_autogen.py +135 -0
  323. alchemiq-0.1.0/tests/unit/test_migrations_ch_history_unit.py +55 -0
  324. alchemiq-0.1.0/tests/unit/test_migrations_ch_introspect_unit.py +57 -0
  325. alchemiq-0.1.0/tests/unit/test_migrations_ch_migration_unit.py +20 -0
  326. alchemiq-0.1.0/tests/unit/test_migrations_ch_operations.py +103 -0
  327. alchemiq-0.1.0/tests/unit/test_migrations_ch_render.py +41 -0
  328. alchemiq-0.1.0/tests/unit/test_migrations_ch_runner_unit.py +390 -0
  329. alchemiq-0.1.0/tests/unit/test_migrations_cli.py +415 -0
  330. alchemiq-0.1.0/tests/unit/test_migrations_config.py +144 -0
  331. alchemiq-0.1.0/tests/unit/test_migrations_import_isolation.py +45 -0
  332. alchemiq-0.1.0/tests/unit/test_migrations_pg_render_item.py +126 -0
  333. alchemiq-0.1.0/tests/unit/test_money.py +78 -0
  334. alchemiq-0.1.0/tests/unit/test_native_interop.py +79 -0
  335. alchemiq-0.1.0/tests/unit/test_native_relationship.py +85 -0
  336. alchemiq-0.1.0/tests/unit/test_numeric.py +48 -0
  337. alchemiq-0.1.0/tests/unit/test_optimistic_lock.py +138 -0
  338. alchemiq-0.1.0/tests/unit/test_outbox_connect.py +35 -0
  339. alchemiq-0.1.0/tests/unit/test_outbox_exports.py +35 -0
  340. alchemiq-0.1.0/tests/unit/test_outbox_message.py +72 -0
  341. alchemiq-0.1.0/tests/unit/test_outbox_model.py +68 -0
  342. alchemiq-0.1.0/tests/unit/test_outbox_publisher.py +16 -0
  343. alchemiq-0.1.0/tests/unit/test_outbox_relay_loop.py +111 -0
  344. alchemiq-0.1.0/tests/unit/test_outbox_taskiq.py +54 -0
  345. alchemiq-0.1.0/tests/unit/test_outbox_write_event.py +42 -0
  346. alchemiq-0.1.0/tests/unit/test_packaging.py +79 -0
  347. alchemiq-0.1.0/tests/unit/test_page.py +46 -0
  348. alchemiq-0.1.0/tests/unit/test_pagination_property.py +23 -0
  349. alchemiq-0.1.0/tests/unit/test_password_hashing.py +150 -0
  350. alchemiq-0.1.0/tests/unit/test_password_hashing_import_isolation.py +19 -0
  351. alchemiq-0.1.0/tests/unit/test_persistence_exceptions.py +24 -0
  352. alchemiq-0.1.0/tests/unit/test_pk_family.py +39 -0
  353. alchemiq-0.1.0/tests/unit/test_post_commit.py +69 -0
  354. alchemiq-0.1.0/tests/unit/test_providers.py +60 -0
  355. alchemiq-0.1.0/tests/unit/test_public_api.py +12 -0
  356. alchemiq-0.1.0/tests/unit/test_public_api_core.py +20 -0
  357. alchemiq-0.1.0/tests/unit/test_public_api_outbox.py +16 -0
  358. alchemiq-0.1.0/tests/unit/test_q_combinators.py +28 -0
  359. alchemiq-0.1.0/tests/unit/test_q_construction.py +28 -0
  360. alchemiq-0.1.0/tests/unit/test_q_serialize_bytes.py +28 -0
  361. alchemiq-0.1.0/tests/unit/test_q_serialize_data.py +86 -0
  362. alchemiq-0.1.0/tests/unit/test_query_exceptions.py +24 -0
  363. alchemiq-0.1.0/tests/unit/test_queryset.py +60 -0
  364. alchemiq-0.1.0/tests/unit/test_queryset_slice.py +38 -0
  365. alchemiq-0.1.0/tests/unit/test_relationship_lazy.py +27 -0
  366. alchemiq-0.1.0/tests/unit/test_relationships.py +72 -0
  367. alchemiq-0.1.0/tests/unit/test_relationships_m2m.py +88 -0
  368. alchemiq-0.1.0/tests/unit/test_relationships_o2o.py +43 -0
  369. alchemiq-0.1.0/tests/unit/test_repository_resolution.py +70 -0
  370. alchemiq-0.1.0/tests/unit/test_scaffold_cli.py +101 -0
  371. alchemiq-0.1.0/tests/unit/test_scaffold_options.py +134 -0
  372. alchemiq-0.1.0/tests/unit/test_scaffold_plan.py +265 -0
  373. alchemiq-0.1.0/tests/unit/test_scaffold_render.py +42 -0
  374. alchemiq-0.1.0/tests/unit/test_self_ref.py +141 -0
  375. alchemiq-0.1.0/tests/unit/test_serialization.py +199 -0
  376. alchemiq-0.1.0/tests/unit/test_serialize_traversal.py +46 -0
  377. alchemiq-0.1.0/tests/unit/test_session_scope.py +31 -0
  378. alchemiq-0.1.0/tests/unit/test_signals.py +91 -0
  379. alchemiq-0.1.0/tests/unit/test_smoke.py +4 -0
  380. alchemiq-0.1.0/tests/unit/test_soft_delete_compile.py +59 -0
  381. alchemiq-0.1.0/tests/unit/test_special.py +96 -0
  382. alchemiq-0.1.0/tests/unit/test_strings.py +125 -0
  383. alchemiq-0.1.0/tests/unit/test_structural_injection.py +68 -0
  384. alchemiq-0.1.0/tests/unit/test_temporal.py +49 -0
  385. alchemiq-0.1.0/tests/unit/test_upsert_builder.py +67 -0
  386. alchemiq-0.1.0/tests/unit/test_validation.py +50 -0
  387. alchemiq-0.1.0/tests/unit/test_wire_codec.py +42 -0
  388. alchemiq-0.1.0/uv.lock +3027 -0
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a problem with alchemiq
4
+ title: ""
5
+ labels: bug
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Description
10
+
11
+ A clear description of what went wrong.
12
+
13
+ ## Reproduction
14
+
15
+ Minimal code or steps that trigger the bug:
16
+
17
+ ```python
18
+ # ...
19
+ ```
20
+
21
+ ## Expected behaviour
22
+
23
+ What you expected to happen.
24
+
25
+ ## Environment
26
+
27
+ - alchemiq version:
28
+ - Python version:
29
+ - Database and version (PostgreSQL or ClickHouse):
30
+ - Relevant extras (fastapi, outbox, redis, and so on):
31
+
32
+ ## Additional context
33
+
34
+ Traceback, logs, or anything else that helps.
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Documentation
4
+ url: https://alchemiq.readthedocs.io
5
+ about: Guides and API reference.
6
+ - name: Questions and discussion
7
+ url: https://github.com/TrifoN-off/alchemiq/discussions
8
+ about: Ask usage questions here instead of opening an issue.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea or improvement
4
+ title: ""
5
+ labels: enhancement
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Problem
10
+
11
+ What are you trying to do, and what is missing or awkward today?
12
+
13
+ ## Proposed solution
14
+
15
+ What you would like alchemiq to do. An API sketch is welcome.
16
+
17
+ ## Alternatives
18
+
19
+ Other approaches you considered.
20
+
21
+ ## Additional context
22
+
23
+ Links, prior art, or related issues.
@@ -0,0 +1,17 @@
1
+ ## Summary
2
+
3
+ What does this change do, and why?
4
+
5
+ ## Type of change
6
+
7
+ - [ ] Bug fix (`fix:`)
8
+ - [ ] New feature (`feat:`)
9
+ - [ ] Breaking change (`feat!:` or `BREAKING CHANGE:`)
10
+ - [ ] Docs, tests, or chore (no release)
11
+
12
+ ## Checklist
13
+
14
+ - [ ] The local gate is green (lint, format, types, tests, docs).
15
+ - [ ] New behaviour has tests; coverage stays at 90 or above.
16
+ - [ ] Docstrings and the matching `docs/guide/` page are updated.
17
+ - [ ] The PR title follows Conventional Commits.
@@ -0,0 +1,100 @@
1
+ # .github/workflows/ci.yml
2
+ name: CI
3
+
4
+ on:
5
+ push:
6
+ pull_request:
7
+
8
+ jobs:
9
+ quality:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: astral-sh/setup-uv@v5
14
+ with:
15
+ enable-cache: true
16
+ - name: Sync (all extras + dev)
17
+ run: uv sync --all-extras --group dev
18
+ - name: Ruff lint
19
+ run: uv run --no-sync ruff check
20
+ - name: Ruff format check
21
+ run: uv run --no-sync ruff format --check
22
+ - name: Type check (ty)
23
+ run: uv run --no-sync ty check
24
+
25
+ typing:
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: astral-sh/setup-uv@v5
30
+ with:
31
+ enable-cache: true
32
+ - name: Sync (all extras + dev)
33
+ run: uv sync --all-extras --group dev
34
+ - name: ty (src + typing fixture)
35
+ run: uv run --no-sync ty check
36
+ - name: mypy (consumer fixture)
37
+ run: uv run --no-sync mypy --follow-imports=silent tests/typing/models.py
38
+ - name: pyright (consumer fixture)
39
+ run: uv run --no-sync pyright --project tests/typing
40
+
41
+ test:
42
+ runs-on: ubuntu-latest
43
+ strategy:
44
+ matrix:
45
+ python-version: ["3.12", "3.13", "3.14"]
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+ - uses: astral-sh/setup-uv@v5
49
+ with:
50
+ enable-cache: true
51
+ python-version: ${{ matrix.python-version }}
52
+ - name: Sync (all extras + dev)
53
+ run: uv sync --all-extras --group dev
54
+ - name: Unit tests
55
+ run: uv run --no-sync pytest -m unit --cov=alchemiq --cov-report=
56
+ - name: Integration tests (PostgreSQL + Redis)
57
+ run: uv run --no-sync pytest -m integration --cov=alchemiq --cov-report= --cov-append
58
+ # File by file: a single-process `pytest -m clickhouse` run flakes on
59
+ # container/event-loop isolation (session container x per-test loop under
60
+ # testcontainers); Ryuk's port mapping flakes in the same setup.
61
+ - name: ClickHouse tests (file by file)
62
+ env:
63
+ TESTCONTAINERS_RYUK_DISABLED: "true"
64
+ run: |
65
+ for f in tests/clickhouse/test_*.py; do
66
+ uv run --no-sync pytest "$f" --cov=alchemiq --cov-report= --cov-append -q
67
+ done
68
+ - name: Coverage gate
69
+ run: uv run --no-sync coverage report --fail-under=90
70
+
71
+ build:
72
+ runs-on: ubuntu-latest
73
+ steps:
74
+ - uses: actions/checkout@v4
75
+ - uses: astral-sh/setup-uv@v5
76
+ - name: Build sdist + wheel
77
+ run: uv build
78
+ - name: Twine metadata check
79
+ run: uvx twine check dist/*
80
+ - name: Assert packaged data files
81
+ run: |
82
+ python -m zipfile -l dist/*.whl | grep -q 'alchemiq/py.typed'
83
+ python -m zipfile -l dist/*.whl | grep -q 'alchemiq/migrations/postgres/_template/script.py.mako'
84
+ - name: Clean-venv core import (no extras)
85
+ run: |
86
+ uv venv --python 3.12 /tmp/ve
87
+ uv pip install --python /tmp/ve dist/*.whl
88
+ /tmp/ve/bin/python -c "import alchemiq; print(alchemiq.__version__)"
89
+
90
+ docs:
91
+ runs-on: ubuntu-latest
92
+ steps:
93
+ - uses: actions/checkout@v4
94
+ - uses: astral-sh/setup-uv@v5
95
+ with:
96
+ enable-cache: true
97
+ - name: Sync (all extras + docs)
98
+ run: uv sync --all-extras --group docs
99
+ - name: Build docs (warnings as errors)
100
+ run: uv run --no-sync sphinx-build -W --keep-going -b html docs docs/_build/html
@@ -0,0 +1,29 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches: [main]
7
+
8
+ concurrency:
9
+ group: release
10
+ cancel-in-progress: false
11
+
12
+ jobs:
13
+ release:
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ contents: write
17
+ id-token: write
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+ - name: Semantic release (version, changelog, tag, GitHub release, build)
23
+ id: release
24
+ uses: python-semantic-release/python-semantic-release@v9.21.1
25
+ with:
26
+ github_token: ${{ secrets.GITHUB_TOKEN }}
27
+ - name: Publish to PyPI (Trusted Publishing / OIDC)
28
+ if: steps.release.outputs.released == 'true'
29
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,24 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ # IDE / editor
13
+ .vscode/
14
+ .idea/
15
+
16
+ # OS files
17
+ .DS_Store
18
+
19
+ # Coverage artifacts
20
+ .coverage
21
+ .coverage.*
22
+
23
+ # Sphinx build output
24
+ docs/_build/
@@ -0,0 +1 @@
1
+ 3.14
@@ -0,0 +1,10 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: ubuntu-24.04
5
+ tools:
6
+ python: "3.12"
7
+ commands:
8
+ - pip install uv
9
+ - uv sync --all-extras --group docs
10
+ - uv run --no-sync sphinx-build -W --keep-going -b html docs $READTHEDOCS_OUTPUT/html
@@ -0,0 +1,89 @@
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
+ > **Note:** From this point forward, changelog entries are managed automatically
9
+ > by [Python Semantic Release](https://python-semantic-release.readthedocs.io/).
10
+ > Do not edit entries below the `[Unreleased]` section manually.
11
+
12
+ <!-- PSR inserts new releases above this line -->
13
+
14
+ ## v0.1.0 (2026-07-05)
15
+
16
+ ### Features
17
+
18
+ - Initial public release
19
+ ([`d088fb1`](https://github.com/TrifoN-off/alchemiq/commit/d088fb162f8fb127416330a3644c01856beb1fc3))
20
+
21
+
22
+ ## [0.1.0] - 2026-06-29
23
+
24
+ ### Added
25
+
26
+ - **Models & field types** - declarative `Model` base with annotation-first field
27
+ types: `Email`, `Phone`, `Password`, `Encrypted`, `Money`, `Slug`, `URL`,
28
+ `UUID4`, `UUID7`, `NanoID`, `Bounded`, `Positive`, `NonNegative`, `Percent`,
29
+ `RoundedDecimal`, `JSON`, `Array`, `Enum`, `Maybe[T]`, `PK`, `Field`,
30
+ `FieldType` (custom field protocol), `CreatedAt`, `UpdatedAt`, `DateTimeTz`,
31
+ `Date`, `Time`, `UnixTimestamp`.
32
+ - **Native-column interop** - `Mapped[T] = mapped_column(...)` passthrough
33
+ registered in `__alchemiq_fields__` with post-mapping reconciliation;
34
+ first-class filter / serialize / FastAPI-schema / primary-key support
35
+ including custom PKs.
36
+ - **Relationships** - `ForeignKey[Model]`, `OneToOne[Model]`, `ManyToMany[Model]`
37
+ sugar (auto join-table generation); native `relationship()` escape-hatch via
38
+ `NATIVE_RELATIONSHIP` sentinel.
39
+ - **Q objects & QuerySet** - chainable `Q` expressions for complex `AND`/`OR`
40
+ filters; `QuerySet` with `.filter()`, `.exclude()`, `.order_by()`,
41
+ `.distinct()`, `.only()` (column projection), `.select_related()`,
42
+ `.prefetch_related()`, `.limit()`, `.offset()`, `.count()`, `.exists()`,
43
+ `.aggregate()`, `.explain(analyze=, format=)`.
44
+ - **Repository** - async `Repository[Model]` with `get`, `filter`, `create`,
45
+ `update`, `delete`, `bulk_create`, `bulk_upsert` (PostgreSQL `ON CONFLICT`),
46
+ `aggregate` (`Count`, `Sum`, `Avg`, `Min`, `Max`), cursor/keyset pagination
47
+ (`cursor_paginate`, returns `CursorPage`), offset pagination (returns `Page`),
48
+ and `.explain()` passthrough; repo-level `cache=`/`cache_clear`/`cache_evict`.
49
+ - **Unit of Work** - `async with UnitOfWork() as uow` coordinating session,
50
+ transaction, `commit()`, `rollback()`, and repository access.
51
+ - **Soft delete** - `Meta.soft_delete = True` adds `deleted_at`; `restore()`,
52
+ `hard_delete()`; automatic exclusion from queries, relationship loads, and
53
+ traversal joins; `with_deleted()` / `only_deleted()` escapes.
54
+ - **Signals** - `pre_create`, `post_create`, `pre_update`, `post_update`,
55
+ `pre_delete`, `post_delete` lifecycle decorators; imperative `connect` /
56
+ `disconnect`; async dispatch.
57
+ - **Optimistic locking** - `Meta.versioned = True` adds `_version` column;
58
+ keyword-only `expected_version` on `update`/`delete`; raises
59
+ `ConcurrentModificationError` (-> HTTP 409); `version_of(obj)` accessor.
60
+ - **Serialization** - `to_dict()` serializes a model instance to a plain dict;
61
+ `to_schema()` returns a Pydantic class mirroring the model's columns;
62
+ `to_pydantic()` converts an instance to a validated schema DTO;
63
+ `Maybe[T]` partial-update sentinel with `Some`/`Nothing` unwrapping.
64
+ - **Configurable password hashing** - `Password` field ships with scrypt by
65
+ default (Python stdlib, no extra); `configure_password_hashing("argon2" | "bcrypt")`
66
+ switches the global scheme at startup (`[argon2]` / `[bcrypt]` extras);
67
+ `check_password` dispatches on the stored hash's algorithm prefix
68
+ for seamless multi-scheme migration without bulk re-hashing.
69
+ - **FastAPI integration** - `crud_router()` generating standard REST endpoints;
70
+ provider DI; health-check router; `install_exception_handlers`.
71
+ - **Outbox & relay** - transactional outbox pattern with `OutboxMessage`,
72
+ `OutboxEvent`, `Relay` background worker, `Publisher`/`publish`,
73
+ `PublishError`, `TransientPublishError`; at-least-once delivery.
74
+ - **FastStream publishing** - broker-agnostic `FastStreamPublisher` adapter;
75
+ consumer dependency injection; lifespan integration.
76
+ - **Caching** - `CacheBackend` / `InMemoryCache` / `configure_cache` /
77
+ `reset_cache`; repository-level `cache=` parameter, `cache_clear`, `cache_evict`.
78
+ - **ClickHouse support** - `ClickHouseModel` base; `ClickHouseRepository`;
79
+ async engine bootstrap; read-path `.explain()`; `LowCardinality` and other
80
+ CH-native field types.
81
+ - **Migrations & unified CLI** - Alembic-backed `alchemiq` sub-commands
82
+ (`makemigrations`, `migrate`, `rollback`, `history`, `showsql`);
83
+ `alchemiq` top-level dispatcher.
84
+ - **`alchemiq init` scaffolding** - guided skeleton generator (stdlib-only,
85
+ no extra deps) for single-app and monorepo layouts via `.tmpl` templates.
86
+ - **Health checks** - `check_health()` returning `HealthReport` /
87
+ `ComponentHealth`.
88
+
89
+ [0.1.0]: https://github.com/TrifoN-off/alchemiq/releases/tag/v0.1.0
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ trifonov.nikit@gmail.com. All complaints will be reviewed and investigated
64
+ promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][mozilla coc].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][faq]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [mozilla coc]: https://github.com/mozilla/diversity
131
+ [faq]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,81 @@
1
+ # Contributing to alchemiq
2
+
3
+ Thanks for your interest in improving alchemiq. This guide covers the local
4
+ setup, the checks every change must pass, and how releases work.
5
+
6
+ ## Development setup
7
+
8
+ alchemiq uses [uv](https://docs.astral.sh/uv/) for environment and dependency
9
+ management, and targets Python 3.12 and newer.
10
+
11
+ ```bash
12
+ git clone git@github.com:TrifoN-off/alchemiq.git
13
+ cd alchemiq
14
+ uv sync --all-extras --group dev
15
+ ```
16
+
17
+ ## The local gate
18
+
19
+ Run the full gate before opening a pull request. Sync first, then use
20
+ `--no-sync` so the optional extras stay installed.
21
+
22
+ ```bash
23
+ uv sync --all-extras --group dev
24
+
25
+ # Lint, format, types
26
+ uv run --no-sync ruff check
27
+ uv run --no-sync ruff format --check
28
+ uv run --no-sync ty check
29
+ uv run --no-sync mypy --follow-imports=silent tests/typing/models.py
30
+ uv run --no-sync pyright --project tests/typing
31
+
32
+ # Tests (run the markers separately)
33
+ uv run --no-sync pytest -m unit --cov=alchemiq --cov-report=
34
+ uv run --no-sync pytest -m integration --cov=alchemiq --cov-report= --cov-append
35
+
36
+ # ClickHouse tests run file by file
37
+ export TESTCONTAINERS_RYUK_DISABLED=true
38
+ for f in tests/clickhouse/test_*.py; do
39
+ uv run --no-sync pytest "$f" --cov=alchemiq --cov-report= --cov-append -q
40
+ done
41
+
42
+ uv run --no-sync coverage report --fail-under=90
43
+
44
+ # Docs (warnings are errors)
45
+ uv sync --all-extras --group docs
46
+ uv run --no-sync sphinx-build -W --keep-going -b html docs docs/_build/html
47
+ ```
48
+
49
+ Integration and ClickHouse tests need Docker; they start PostgreSQL and
50
+ ClickHouse through testcontainers.
51
+
52
+ ## Commit messages
53
+
54
+ This project uses [Conventional Commits](https://www.conventionalcommits.org/).
55
+ Python Semantic Release derives the version and changelog from them, so the
56
+ prefix matters:
57
+
58
+ | Prefix | Effect (while on 0.x) |
59
+ |---|---|
60
+ | `fix:` | patch release |
61
+ | `feat:` | minor release |
62
+ | `feat!:` or `BREAKING CHANGE:` | minor while on 0.x |
63
+ | `docs:` `test:` `chore:` `ci:` `refactor:` | no release |
64
+
65
+ Do not bump the version or edit `CHANGELOG.md` by hand; the release pipeline
66
+ owns both.
67
+
68
+ ## Pull requests
69
+
70
+ 1. Branch off `main`.
71
+ 2. Keep the change focused, and add tests for new behaviour (coverage stays at
72
+ 90 or above).
73
+ 3. Update the matching `docs/guide/` page and docstrings in the same PR.
74
+ 4. Make sure the local gate is green.
75
+ 5. Open the PR with a Conventional Commit style title.
76
+
77
+ ## Public API
78
+
79
+ The public surface is whatever `alchemiq.__all__` (and each integration
80
+ subpackage's `__all__`) exports. Adding to it is a `feat:`; changing or removing
81
+ from it is a breaking change.
alchemiq-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Trifonov Nikita
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.