piccolo 1.9.0__tar.gz → 1.11.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 (384) hide show
  1. {piccolo-1.9.0 → piccolo-1.11.0}/PKG-INFO +1 -1
  2. piccolo-1.11.0/piccolo/__init__.py +1 -0
  3. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/fixtures/commands/load.py +1 -1
  4. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/auto/__init__.py +8 -0
  5. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/auto/migration_manager.py +2 -1
  6. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/commands/backwards.py +3 -1
  7. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/commands/base.py +1 -1
  8. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/commands/check.py +1 -1
  9. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/commands/clean.py +1 -1
  10. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/commands/forwards.py +3 -1
  11. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/commands/new.py +4 -2
  12. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/schema/commands/generate.py +2 -2
  13. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/shell/commands/run.py +1 -1
  14. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/column_types.py +56 -39
  15. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/defaults/base.py +1 -1
  16. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/defaults/date.py +9 -1
  17. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/defaults/interval.py +1 -0
  18. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/defaults/time.py +9 -1
  19. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/defaults/timestamp.py +1 -0
  20. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/defaults/uuid.py +1 -1
  21. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/m2m.py +7 -7
  22. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/operators/comparison.py +4 -0
  23. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/conf/apps.py +9 -4
  24. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/engine/base.py +69 -20
  25. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/engine/cockroach.py +2 -3
  26. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/engine/postgres.py +33 -19
  27. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/engine/sqlite.py +27 -22
  28. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/functions/__init__.py +11 -1
  29. piccolo-1.11.0/piccolo/query/functions/datetime.py +260 -0
  30. piccolo-1.11.0/piccolo/query/functions/string.py +118 -0
  31. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/create_index.py +1 -1
  32. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/drop_index.py +1 -1
  33. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/objects.py +7 -7
  34. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/select.py +13 -7
  35. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/mixins.py +3 -10
  36. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/schema.py +18 -11
  37. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/table.py +22 -21
  38. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/encoding.py +5 -3
  39. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo.egg-info/PKG-INFO +1 -1
  40. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo.egg-info/SOURCES.txt +2 -0
  41. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/auto/integration/test_migrations.py +1 -1
  42. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_array.py +28 -0
  43. {piccolo-1.9.0 → piccolo-1.11.0}/tests/conf/test_apps.py +1 -1
  44. {piccolo-1.9.0 → piccolo-1.11.0}/tests/engine/test_nested_transaction.py +2 -0
  45. {piccolo-1.9.0 → piccolo-1.11.0}/tests/engine/test_transaction.py +1 -2
  46. piccolo-1.11.0/tests/query/functions/test_datetime.py +114 -0
  47. piccolo-1.11.0/tests/query/functions/test_string.py +57 -0
  48. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_indexes.py +4 -2
  49. {piccolo-1.9.0 → piccolo-1.11.0}/tests/utils/test_pydantic.py +70 -29
  50. piccolo-1.9.0/piccolo/__init__.py +0 -1
  51. piccolo-1.9.0/piccolo/query/functions/string.py +0 -73
  52. piccolo-1.9.0/tests/query/functions/test_string.py +0 -25
  53. {piccolo-1.9.0 → piccolo-1.11.0}/LICENSE +0 -0
  54. {piccolo-1.9.0 → piccolo-1.11.0}/README.md +0 -0
  55. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/__init__.py +0 -0
  56. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/app/__init__.py +0 -0
  57. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/app/commands/__init__.py +0 -0
  58. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/app/commands/new.py +0 -0
  59. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/app/commands/show_all.py +0 -0
  60. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/app/commands/templates/piccolo_app.py.jinja +0 -0
  61. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/app/commands/templates/tables.py.jinja +0 -0
  62. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/app/piccolo_app.py +0 -0
  63. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/__init__.py +0 -0
  64. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/__init__.py +0 -0
  65. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/new.py +0 -0
  66. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/README.md.jinja +0 -0
  67. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja +0 -0
  68. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/_esmerald_app.py.jinja +0 -0
  69. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja +0 -0
  70. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/_lilya_app.py.jinja +0 -0
  71. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/_litestar_app.py.jinja +0 -0
  72. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/_starlette_app.py.jinja +0 -0
  73. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/app.py.jinja +0 -0
  74. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/conftest.py.jinja +0 -0
  75. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/home/__init__.py.jinja +0 -0
  76. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/home/_blacksheep_endpoints.py.jinja +0 -0
  77. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/home/_esmerald_endpoints.py.jinja +0 -0
  78. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/home/_lilya_endpoints.py.jinja +0 -0
  79. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/home/_litestar_endpoints.py.jinja +0 -0
  80. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/home/_starlette_endpoints.py.jinja +0 -0
  81. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja +0 -0
  82. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/home/piccolo_app.py.jinja +0 -0
  83. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/home/piccolo_migrations/README.md +0 -0
  84. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/home/tables.py.jinja +0 -0
  85. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/home/templates/base.html.jinja_raw +0 -0
  86. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/home/templates/home.html.jinja_raw +0 -0
  87. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/main.py.jinja +0 -0
  88. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/piccolo_conf.py.jinja +0 -0
  89. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/piccolo_conf_test.py.jinja +0 -0
  90. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/requirements.txt.jinja +0 -0
  91. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/static/favicon.ico +0 -0
  92. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/commands/templates/app/static/main.css +0 -0
  93. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/asgi/piccolo_app.py +0 -0
  94. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/fixtures/__init__.py +0 -0
  95. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/fixtures/commands/__init__.py +0 -0
  96. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/fixtures/commands/dump.py +0 -0
  97. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/fixtures/commands/shared.py +0 -0
  98. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/fixtures/piccolo_app.py +0 -0
  99. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/meta/__init__.py +0 -0
  100. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/meta/commands/__init__.py +0 -0
  101. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/meta/commands/version.py +0 -0
  102. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/meta/piccolo_app.py +0 -0
  103. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/__init__.py +0 -0
  104. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/auto/diffable_table.py +0 -0
  105. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/auto/operations.py +0 -0
  106. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/auto/schema_differ.py +0 -0
  107. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/auto/schema_snapshot.py +0 -0
  108. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/auto/serialisation.py +0 -0
  109. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/auto/serialisation_legacy.py +0 -0
  110. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/commands/__init__.py +0 -0
  111. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/commands/templates/migration.py.jinja +0 -0
  112. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/piccolo_app.py +0 -0
  113. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/migrations/tables.py +0 -0
  114. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/playground/__init__.py +0 -0
  115. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/playground/commands/__init__.py +0 -0
  116. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/playground/commands/run.py +0 -0
  117. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/playground/piccolo_app.py +0 -0
  118. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/project/__init__.py +0 -0
  119. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/project/commands/__init__.py +0 -0
  120. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/project/commands/new.py +0 -0
  121. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/project/commands/templates/piccolo_conf.py.jinja +0 -0
  122. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/project/piccolo_app.py +0 -0
  123. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/schema/__init__.py +0 -0
  124. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/schema/commands/__init__.py +0 -0
  125. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/schema/commands/exceptions.py +0 -0
  126. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/schema/commands/graph.py +0 -0
  127. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/schema/commands/templates/graphviz.dot.jinja +0 -0
  128. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/schema/piccolo_app.py +0 -0
  129. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/shell/__init__.py +0 -0
  130. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/shell/commands/__init__.py +0 -0
  131. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/shell/piccolo_app.py +0 -0
  132. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/sql_shell/__init__.py +0 -0
  133. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/sql_shell/commands/__init__.py +0 -0
  134. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/sql_shell/commands/run.py +0 -0
  135. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/sql_shell/piccolo_app.py +0 -0
  136. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/tester/__init__.py +0 -0
  137. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/tester/commands/__init__.py +0 -0
  138. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/tester/commands/run.py +0 -0
  139. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/tester/piccolo_app.py +0 -0
  140. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/user/__init__.py +0 -0
  141. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/user/commands/__init__.py +0 -0
  142. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/user/commands/change_password.py +0 -0
  143. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/user/commands/change_permissions.py +0 -0
  144. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/user/commands/create.py +0 -0
  145. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/user/commands/list.py +0 -0
  146. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/user/piccolo_app.py +0 -0
  147. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/user/piccolo_migrations/2019-11-14T21-52-21.py +0 -0
  148. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/user/piccolo_migrations/2020-06-11T21-38-55.py +0 -0
  149. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/user/piccolo_migrations/2021-04-30T16-14-15.py +0 -0
  150. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/user/piccolo_migrations/__init__.py +0 -0
  151. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/apps/user/tables.py +0 -0
  152. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/__init__.py +0 -0
  153. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/base.py +0 -0
  154. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/choices.py +0 -0
  155. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/combination.py +0 -0
  156. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/defaults/__init__.py +0 -0
  157. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/defaults/timestamptz.py +0 -0
  158. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/indexes.py +0 -0
  159. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/operators/__init__.py +0 -0
  160. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/operators/base.py +0 -0
  161. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/operators/math.py +0 -0
  162. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/operators/string.py +0 -0
  163. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/readable.py +0 -0
  164. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/columns/reference.py +0 -0
  165. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/conf/__init__.py +0 -0
  166. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/custom_types.py +0 -0
  167. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/engine/__init__.py +0 -0
  168. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/engine/exceptions.py +0 -0
  169. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/engine/finder.py +0 -0
  170. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/main.py +0 -0
  171. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/py.typed +0 -0
  172. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/__init__.py +0 -0
  173. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/base.py +0 -0
  174. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/functions/aggregate.py +0 -0
  175. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/functions/base.py +0 -0
  176. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/functions/math.py +0 -0
  177. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/functions/type_conversion.py +0 -0
  178. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/__init__.py +0 -0
  179. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/alter.py +0 -0
  180. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/count.py +0 -0
  181. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/create.py +0 -0
  182. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/delete.py +0 -0
  183. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/exists.py +0 -0
  184. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/indexes.py +0 -0
  185. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/insert.py +0 -0
  186. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/raw.py +0 -0
  187. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/refresh.py +0 -0
  188. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/table_exists.py +0 -0
  189. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/methods/update.py +0 -0
  190. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/query/proxy.py +0 -0
  191. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/querystring.py +0 -0
  192. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/table_reflection.py +0 -0
  193. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/testing/__init__.py +0 -0
  194. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/testing/model_builder.py +0 -0
  195. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/testing/random_builder.py +0 -0
  196. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/__init__.py +0 -0
  197. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/dictionary.py +0 -0
  198. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/graphlib/__init__.py +0 -0
  199. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/graphlib/_graphlib.py +0 -0
  200. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/lazy_loader.py +0 -0
  201. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/list.py +0 -0
  202. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/naming.py +0 -0
  203. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/objects.py +0 -0
  204. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/printing.py +0 -0
  205. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/pydantic.py +0 -0
  206. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/repr.py +0 -0
  207. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/sql_values.py +0 -0
  208. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/sync.py +0 -0
  209. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo/utils/warnings.py +0 -0
  210. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo.egg-info/dependency_links.txt +0 -0
  211. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo.egg-info/entry_points.txt +0 -0
  212. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo.egg-info/requires.txt +0 -0
  213. {piccolo-1.9.0 → piccolo-1.11.0}/piccolo.egg-info/top_level.txt +0 -0
  214. {piccolo-1.9.0 → piccolo-1.11.0}/profiling/__init__.py +0 -0
  215. {piccolo-1.9.0 → piccolo-1.11.0}/profiling/run_profile.py +0 -0
  216. {piccolo-1.9.0 → piccolo-1.11.0}/pyproject.toml +0 -0
  217. {piccolo-1.9.0 → piccolo-1.11.0}/setup.cfg +0 -0
  218. {piccolo-1.9.0 → piccolo-1.11.0}/setup.py +0 -0
  219. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/__init__.py +0 -0
  220. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/app/__init__.py +0 -0
  221. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/app/commands/__init__.py +0 -0
  222. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/app/commands/test_new.py +0 -0
  223. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/app/commands/test_show_all.py +0 -0
  224. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/asgi/__init__.py +0 -0
  225. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/asgi/commands/__init__.py +0 -0
  226. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/asgi/commands/test_new.py +0 -0
  227. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/fixtures/__init__.py +0 -0
  228. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/fixtures/commands/__init__.py +0 -0
  229. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/fixtures/commands/test_dump_load.py +0 -0
  230. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/fixtures/commands/test_shared.py +0 -0
  231. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/meta/__init__.py +0 -0
  232. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/meta/commands/__init__.py +0 -0
  233. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/meta/commands/test_version.py +0 -0
  234. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/__init__.py +0 -0
  235. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/auto/__init__.py +0 -0
  236. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/auto/integration/__init__.py +0 -0
  237. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/auto/test_diffable_table.py +0 -0
  238. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/auto/test_migration_manager.py +0 -0
  239. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/auto/test_schema_differ.py +0 -0
  240. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/auto/test_schema_snapshot.py +0 -0
  241. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/auto/test_serialisation.py +0 -0
  242. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/commands/__init__.py +0 -0
  243. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/commands/test_base.py +0 -0
  244. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/commands/test_check.py +0 -0
  245. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/commands/test_clean.py +0 -0
  246. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/commands/test_forwards_backwards.py +0 -0
  247. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/commands/test_migrations/2020-03-31T20-38-22.py +0 -0
  248. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/commands/test_migrations/__init__.py +0 -0
  249. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/commands/test_new.py +0 -0
  250. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/migrations/test_migration.py +0 -0
  251. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/project/__init__.py +0 -0
  252. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/project/commands/__init__.py +0 -0
  253. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/project/commands/test_new.py +0 -0
  254. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/schema/__init__.py +0 -0
  255. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/shell/__init__.py +0 -0
  256. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/shell/commands/__init__.py +0 -0
  257. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/shell/commands/test_run.py +0 -0
  258. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/sql_shell/__init__.py +0 -0
  259. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/sql_shell/commands/__init__.py +0 -0
  260. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/sql_shell/commands/test_run.py +0 -0
  261. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/tester/__init__.py +0 -0
  262. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/user/__init__.py +0 -0
  263. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/user/commands/__init__.py +0 -0
  264. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/user/commands/test_change_password.py +0 -0
  265. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/user/commands/test_change_permissions.py +0 -0
  266. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/user/commands/test_create.py +0 -0
  267. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/user/commands/test_list.py +0 -0
  268. {piccolo-1.9.0 → piccolo-1.11.0}/tests/apps/user/test_tables.py +0 -0
  269. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/__init__.py +0 -0
  270. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/m2m/__init__.py +0 -0
  271. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/m2m/base.py +0 -0
  272. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/m2m/test_m2m.py +0 -0
  273. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/m2m/test_m2m_schema.py +0 -0
  274. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_base.py +0 -0
  275. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_bigint.py +0 -0
  276. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_boolean.py +0 -0
  277. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_bytea.py +0 -0
  278. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_choices.py +0 -0
  279. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_combination.py +0 -0
  280. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_date.py +0 -0
  281. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_db_column_name.py +0 -0
  282. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_defaults.py +0 -0
  283. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_double_precision.py +0 -0
  284. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_get_sql_value.py +0 -0
  285. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_interval.py +0 -0
  286. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_json.py +0 -0
  287. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_jsonb.py +0 -0
  288. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_numeric.py +0 -0
  289. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_primary_key.py +0 -0
  290. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_readable.py +0 -0
  291. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_real.py +0 -0
  292. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_reference.py +0 -0
  293. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_reserved_column_names.py +0 -0
  294. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_smallint.py +0 -0
  295. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_time.py +0 -0
  296. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_timestamp.py +0 -0
  297. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_timestamptz.py +0 -0
  298. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_uuid.py +0 -0
  299. {piccolo-1.9.0 → piccolo-1.11.0}/tests/columns/test_varchar.py +0 -0
  300. {piccolo-1.9.0 → piccolo-1.11.0}/tests/conf/__init__.py +0 -0
  301. {piccolo-1.9.0 → piccolo-1.11.0}/tests/conf/example.py +0 -0
  302. {piccolo-1.9.0 → piccolo-1.11.0}/tests/engine/__init__.py +0 -0
  303. {piccolo-1.9.0 → piccolo-1.11.0}/tests/engine/test_extra_nodes.py +0 -0
  304. {piccolo-1.9.0 → piccolo-1.11.0}/tests/engine/test_logging.py +0 -0
  305. {piccolo-1.9.0 → piccolo-1.11.0}/tests/engine/test_pool.py +0 -0
  306. {piccolo-1.9.0 → piccolo-1.11.0}/tests/engine/test_version_parsing.py +0 -0
  307. {piccolo-1.9.0 → piccolo-1.11.0}/tests/example_apps/__init__.py +0 -0
  308. {piccolo-1.9.0 → piccolo-1.11.0}/tests/example_apps/mega/__init__.py +0 -0
  309. {piccolo-1.9.0 → piccolo-1.11.0}/tests/example_apps/mega/piccolo_app.py +0 -0
  310. {piccolo-1.9.0 → piccolo-1.11.0}/tests/example_apps/mega/piccolo_migrations/2021-09-20T21-23-25-698988.py +0 -0
  311. {piccolo-1.9.0 → piccolo-1.11.0}/tests/example_apps/mega/piccolo_migrations/__init__.py +0 -0
  312. {piccolo-1.9.0 → piccolo-1.11.0}/tests/example_apps/mega/tables.py +0 -0
  313. {piccolo-1.9.0 → piccolo-1.11.0}/tests/example_apps/music/__init__.py +0 -0
  314. {piccolo-1.9.0 → piccolo-1.11.0}/tests/example_apps/music/piccolo_app.py +0 -0
  315. {piccolo-1.9.0 → piccolo-1.11.0}/tests/example_apps/music/tables.py +0 -0
  316. {piccolo-1.9.0 → piccolo-1.11.0}/tests/example_apps/music/tables_detailed.py +0 -0
  317. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/__init__.py +0 -0
  318. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/functions/__init__.py +0 -0
  319. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/functions/base.py +0 -0
  320. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/functions/test_functions.py +0 -0
  321. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/functions/test_math.py +0 -0
  322. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/functions/test_type_conversion.py +0 -0
  323. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/mixins/__init__.py +0 -0
  324. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/mixins/test_columns_delegate.py +0 -0
  325. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/mixins/test_order_by_delegate.py +0 -0
  326. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/test_await.py +0 -0
  327. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/test_camelcase.py +0 -0
  328. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/test_freeze.py +0 -0
  329. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/test_gather.py +0 -0
  330. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/test_querystring.py +0 -0
  331. {piccolo-1.9.0 → piccolo-1.11.0}/tests/query/test_slots.py +0 -0
  332. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/__init__.py +0 -0
  333. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/instance/__init__.py +0 -0
  334. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/instance/test_create.py +0 -0
  335. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/instance/test_get_related.py +0 -0
  336. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/instance/test_get_related_readable.py +0 -0
  337. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/instance/test_instantiate.py +0 -0
  338. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/instance/test_remove.py +0 -0
  339. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/instance/test_save.py +0 -0
  340. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/instance/test_to_dict.py +0 -0
  341. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_all_columns.py +0 -0
  342. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_alter.py +0 -0
  343. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_batch.py +0 -0
  344. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_callback.py +0 -0
  345. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_constructor.py +0 -0
  346. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_count.py +0 -0
  347. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_create.py +0 -0
  348. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_create_db_tables.py +0 -0
  349. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_create_table_class.py +0 -0
  350. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_delete.py +0 -0
  351. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_drop_db_tables.py +0 -0
  352. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_exists.py +0 -0
  353. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_from_dict.py +0 -0
  354. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_inheritance.py +0 -0
  355. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_insert.py +0 -0
  356. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_join.py +0 -0
  357. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_join_on.py +0 -0
  358. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_metaclass.py +0 -0
  359. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_objects.py +0 -0
  360. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_output.py +0 -0
  361. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_raw.py +0 -0
  362. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_ref.py +0 -0
  363. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_refresh.py +0 -0
  364. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_repr.py +0 -0
  365. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_select.py +0 -0
  366. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_str.py +0 -0
  367. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_table_exists.py +0 -0
  368. {piccolo-1.9.0 → piccolo-1.11.0}/tests/table/test_update.py +0 -0
  369. {piccolo-1.9.0 → piccolo-1.11.0}/tests/test_main.py +0 -0
  370. {piccolo-1.9.0 → piccolo-1.11.0}/tests/test_schema.py +0 -0
  371. {piccolo-1.9.0 → piccolo-1.11.0}/tests/testing/__init__.py +0 -0
  372. {piccolo-1.9.0 → piccolo-1.11.0}/tests/testing/test_model_builder.py +0 -0
  373. {piccolo-1.9.0 → piccolo-1.11.0}/tests/testing/test_random_builder.py +0 -0
  374. {piccolo-1.9.0 → piccolo-1.11.0}/tests/utils/__init__.py +0 -0
  375. {piccolo-1.9.0 → piccolo-1.11.0}/tests/utils/test_dictionary.py +0 -0
  376. {piccolo-1.9.0 → piccolo-1.11.0}/tests/utils/test_encoding.py +0 -0
  377. {piccolo-1.9.0 → piccolo-1.11.0}/tests/utils/test_lazy_loader.py +0 -0
  378. {piccolo-1.9.0 → piccolo-1.11.0}/tests/utils/test_list.py +0 -0
  379. {piccolo-1.9.0 → piccolo-1.11.0}/tests/utils/test_naming.py +0 -0
  380. {piccolo-1.9.0 → piccolo-1.11.0}/tests/utils/test_printing.py +0 -0
  381. {piccolo-1.9.0 → piccolo-1.11.0}/tests/utils/test_sql_values.py +0 -0
  382. {piccolo-1.9.0 → piccolo-1.11.0}/tests/utils/test_sync.py +0 -0
  383. {piccolo-1.9.0 → piccolo-1.11.0}/tests/utils/test_table_reflection.py +0 -0
  384. {piccolo-1.9.0 → piccolo-1.11.0}/tests/utils/test_warnings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: piccolo
3
- Version: 1.9.0
3
+ Version: 1.11.0
4
4
  Summary: A fast, user friendly ORM and query builder which supports asyncio.
5
5
  Home-page: https://github.com/piccolo-orm/piccolo
6
6
  Author: Daniel Townsend
@@ -0,0 +1 @@
1
+ __VERSION__ = "1.11.0"
@@ -51,7 +51,7 @@ async def load_json_string(
51
51
  finder = Finder()
52
52
  engine = engine_finder()
53
53
 
54
- if not engine:
54
+ if engine is None:
55
55
  raise Exception("Unable to find the engine.")
56
56
 
57
57
  # This is what we want to the insert into the database:
@@ -2,3 +2,11 @@ from .diffable_table import DiffableTable
2
2
  from .migration_manager import MigrationManager
3
3
  from .schema_differ import AlterStatements, SchemaDiffer
4
4
  from .schema_snapshot import SchemaSnapshot
5
+
6
+ __all__ = [
7
+ "DiffableTable",
8
+ "MigrationManager",
9
+ "AlterStatements",
10
+ "SchemaDiffer",
11
+ "SchemaSnapshot",
12
+ ]
@@ -261,7 +261,8 @@ class MigrationManager:
261
261
  cleaned_params = deserialise_params(params=params)
262
262
  column = column_class(**cleaned_params)
263
263
  column._meta.name = column_name
264
- column._meta.db_column_name = db_column_name
264
+ if db_column_name:
265
+ column._meta.db_column_name = db_column_name
265
266
 
266
267
  self.add_columns.append(
267
268
  AddColumnClass(
@@ -32,7 +32,9 @@ class BackwardsMigrationManager(BaseMigrationManager):
32
32
 
33
33
  async def run_migrations_backwards(self, app_config: AppConfig):
34
34
  migration_modules: t.Dict[str, MigrationModule] = (
35
- self.get_migration_modules(app_config.migrations_folder_path)
35
+ self.get_migration_modules(
36
+ app_config.resolved_migrations_folder_path
37
+ )
36
38
  )
37
39
 
38
40
  ran_migration_ids = await Migration.get_migrations_which_ran(
@@ -86,7 +86,7 @@ class BaseMigrationManager(Finder):
86
86
  """
87
87
  migration_managers: t.List[MigrationManager] = []
88
88
 
89
- migrations_folder = app_config.migrations_folder_path
89
+ migrations_folder = app_config.resolved_migrations_folder_path
90
90
 
91
91
  migration_modules: t.Dict[str, MigrationModule] = (
92
92
  self.get_migration_modules(migrations_folder)
@@ -36,7 +36,7 @@ class CheckMigrationManager(BaseMigrationManager):
36
36
  continue
37
37
 
38
38
  migration_modules = self.get_migration_modules(
39
- app_config.migrations_folder_path
39
+ app_config.resolved_migrations_folder_path
40
40
  )
41
41
  ids = self.get_migration_ids(migration_modules)
42
42
  for _id in ids:
@@ -20,7 +20,7 @@ class CleanMigrationManager(BaseMigrationManager):
20
20
  app_config = self.get_app_config(app_name=self.app_name)
21
21
 
22
22
  migration_module_dict = self.get_migration_modules(
23
- folder_path=app_config.migrations_folder_path
23
+ folder_path=app_config.resolved_migrations_folder_path
24
24
  )
25
25
 
26
26
  # The migration IDs which are in migration modules.
@@ -33,7 +33,9 @@ class ForwardsMigrationManager(BaseMigrationManager):
33
33
  )
34
34
 
35
35
  migration_modules: t.Dict[str, MigrationModule] = (
36
- self.get_migration_modules(app_config.migrations_folder_path)
36
+ self.get_migration_modules(
37
+ app_config.resolved_migrations_folder_path
38
+ )
37
39
  )
38
40
 
39
41
  ids = self.get_migration_ids(migration_modules)
@@ -98,7 +98,9 @@ def _generate_migration_meta(app_config: AppConfig) -> NewMigrationMeta:
98
98
 
99
99
  filename = f"{cleaned_app_name}_{cleaned_id}"
100
100
 
101
- path = os.path.join(app_config.migrations_folder_path, f"{filename}.py")
101
+ path = os.path.join(
102
+ app_config.resolved_migrations_folder_path, f"{filename}.py"
103
+ )
102
104
 
103
105
  return NewMigrationMeta(
104
106
  migration_id=_id, migration_filename=filename, migration_path=path
@@ -255,7 +257,7 @@ async def new(
255
257
 
256
258
  app_config = Finder().get_app_config(app_name=app_name)
257
259
 
258
- _create_migrations_folder(app_config.migrations_folder_path)
260
+ _create_migrations_folder(app_config.resolved_migrations_folder_path)
259
261
 
260
262
  try:
261
263
  await _create_new_migration(
@@ -313,7 +313,7 @@ COLUMN_TYPE_MAP_COCKROACH: t.Dict[str, t.Type[Column]] = {
313
313
  **{"integer": BigInt, "json": JSONB},
314
314
  }
315
315
 
316
- COLUMN_DEFAULT_PARSER = {
316
+ COLUMN_DEFAULT_PARSER: t.Dict[t.Type[Column], t.Any] = {
317
317
  BigInt: re.compile(r"^'?(?P<value>-?[0-9]\d*)'?(?:::bigint)?$"),
318
318
  Boolean: re.compile(r"^(?P<value>true|false)$"),
319
319
  Bytea: re.compile(r"'(?P<value>.*)'::bytea$"),
@@ -373,7 +373,7 @@ COLUMN_DEFAULT_PARSER = {
373
373
  }
374
374
 
375
375
  # Re-map for Cockroach compatibility.
376
- COLUMN_DEFAULT_PARSER_COCKROACH = {
376
+ COLUMN_DEFAULT_PARSER_COCKROACH: t.Dict[t.Type[Column], t.Any] = {
377
377
  **COLUMN_DEFAULT_PARSER,
378
378
  BigInt: re.compile(r"^(?P<value>-?\d+)$"),
379
379
  }
@@ -24,7 +24,7 @@ def start_ipython_shell(**tables: t.Type[Table]): # pragma: no cover
24
24
  if table_class_name not in existing_global_names:
25
25
  globals()[table_class_name] = table_class
26
26
 
27
- IPython.embed(using=_asyncio_runner, colors="neutral")
27
+ IPython.embed(using=_asyncio_runner, colors="neutral") # type: ignore
28
28
 
29
29
 
30
30
  def run() -> None:
@@ -57,7 +57,11 @@ from piccolo.columns.defaults.timestamptz import (
57
57
  TimestamptzNow,
58
58
  )
59
59
  from piccolo.columns.defaults.uuid import UUID4, UUIDArg
60
- from piccolo.columns.operators.comparison import ArrayAll, ArrayAny
60
+ from piccolo.columns.operators.comparison import (
61
+ ArrayAll,
62
+ ArrayAny,
63
+ ArrayNotAny,
64
+ )
61
65
  from piccolo.columns.operators.string import Concat
62
66
  from piccolo.columns.reference import LazyTableReference
63
67
  from piccolo.querystring import QueryString
@@ -82,47 +86,38 @@ class ConcatDelegate:
82
86
 
83
87
  def get_querystring(
84
88
  self,
85
- column_name: str,
86
- value: t.Union[str, Varchar, Text],
89
+ column: Column,
90
+ value: t.Union[str, Column, QueryString],
87
91
  reverse: bool = False,
88
92
  ) -> QueryString:
89
- if isinstance(value, (Varchar, Text)):
90
- column: Column = value
93
+ """
94
+ :param reverse:
95
+ By default the value is appended to the column's value. If
96
+ ``reverse=True`` then the value is prepended to the column's
97
+ value instead.
98
+
99
+ """
100
+ if isinstance(value, Column):
91
101
  if len(column._meta.call_chain) > 0:
92
102
  raise ValueError(
93
103
  "Adding values across joins isn't currently supported."
94
104
  )
95
- other_column_name = column._meta.db_column_name
96
- if reverse:
97
- return QueryString(
98
- Concat.template.format(
99
- value_1=other_column_name, value_2=column_name
100
- )
101
- )
102
- else:
103
- return QueryString(
104
- Concat.template.format(
105
- value_1=column_name, value_2=other_column_name
106
- )
107
- )
108
105
  elif isinstance(value, str):
109
- if reverse:
110
- value_1 = QueryString("CAST({} AS text)", value)
111
- return QueryString(
112
- Concat.template.format(value_1="{}", value_2=column_name),
113
- value_1,
114
- )
115
- else:
116
- value_2 = QueryString("CAST({} AS text)", value)
117
- return QueryString(
118
- Concat.template.format(value_1=column_name, value_2="{}"),
119
- value_2,
120
- )
121
- else:
106
+ value = QueryString("CAST({} AS TEXT)", value)
107
+ elif not isinstance(value, QueryString):
122
108
  raise ValueError(
123
- "Only str, Varchar columns, and Text columns can be added."
109
+ "Only str, Column and QueryString values can be added."
124
110
  )
125
111
 
112
+ args = [value, column] if reverse else [column, value]
113
+
114
+ # We use the concat operator instead of the concat function, because
115
+ # this is what we historically used, and they treat null values
116
+ # differently.
117
+ return QueryString(
118
+ Concat.template.format(value_1="{}", value_2="{}"), *args
119
+ )
120
+
126
121
 
127
122
  class MathDelegate:
128
123
  """
@@ -336,12 +331,13 @@ class Varchar(Column):
336
331
 
337
332
  def __add__(self, value: t.Union[str, Varchar, Text]) -> QueryString:
338
333
  return self.concat_delegate.get_querystring(
339
- column_name=self._meta.db_column_name, value=value
334
+ column=self,
335
+ value=value,
340
336
  )
341
337
 
342
338
  def __radd__(self, value: t.Union[str, Varchar, Text]) -> QueryString:
343
339
  return self.concat_delegate.get_querystring(
344
- column_name=self._meta.db_column_name,
340
+ column=self,
345
341
  value=value,
346
342
  reverse=True,
347
343
  )
@@ -438,12 +434,13 @@ class Text(Column):
438
434
 
439
435
  def __add__(self, value: t.Union[str, Varchar, Text]) -> QueryString:
440
436
  return self.concat_delegate.get_querystring(
441
- column_name=self._meta.db_column_name, value=value
437
+ column=self,
438
+ value=value,
442
439
  )
443
440
 
444
441
  def __radd__(self, value: t.Union[str, Varchar, Text]) -> QueryString:
445
442
  return self.concat_delegate.get_querystring(
446
- column_name=self._meta.db_column_name,
443
+ column=self,
447
444
  value=value,
448
445
  reverse=True,
449
446
  )
@@ -1952,7 +1949,9 @@ class ForeignKey(Column, t.Generic[ReferencedTable]):
1952
1949
 
1953
1950
  if is_table_class:
1954
1951
  # Record the reverse relationship on the target table.
1955
- references._meta._foreign_key_references.append(self)
1952
+ t.cast(
1953
+ t.Type[Table], references
1954
+ )._meta._foreign_key_references.append(self)
1956
1955
 
1957
1956
  # Allow columns on the referenced table to be accessed via
1958
1957
  # auto completion.
@@ -2670,6 +2669,24 @@ class Array(Column):
2670
2669
  else:
2671
2670
  raise ValueError("Unrecognised engine type")
2672
2671
 
2672
+ def not_any(self, value: t.Any) -> Where:
2673
+ """
2674
+ Check if the given value isn't in the array.
2675
+
2676
+ .. code-block:: python
2677
+
2678
+ >>> await Ticket.select().where(Ticket.seat_numbers.not_any(510))
2679
+
2680
+ """
2681
+ engine_type = self._meta.engine_type
2682
+
2683
+ if engine_type in ("postgres", "cockroach"):
2684
+ return Where(column=self, value=value, operator=ArrayNotAny)
2685
+ elif engine_type == "sqlite":
2686
+ return self.not_like(f"%{value}%")
2687
+ else:
2688
+ raise ValueError("Unrecognised engine type")
2689
+
2673
2690
  def all(self, value: t.Any) -> Where:
2674
2691
  """
2675
2692
  Check if all of the items in the array match the given value.
@@ -2688,7 +2705,7 @@ class Array(Column):
2688
2705
  else:
2689
2706
  raise ValueError("Unrecognised engine type")
2690
2707
 
2691
- def cat(self, value: t.List[t.Any]) -> QueryString:
2708
+ def cat(self, value: t.Union[t.Any, t.List[t.Any]]) -> QueryString:
2692
2709
  """
2693
2710
  Used in an ``update`` query to append items to an array.
2694
2711
 
@@ -2719,7 +2736,7 @@ class Array(Column):
2719
2736
  db_column_name = self._meta.db_column_name
2720
2737
  return QueryString(f'array_cat("{db_column_name}", {{}})', value)
2721
2738
 
2722
- def __add__(self, value: t.List[t.Any]) -> QueryString:
2739
+ def __add__(self, value: t.Union[t.Any, t.List[t.Any]]) -> QueryString:
2723
2740
  return self.cat(value)
2724
2741
 
2725
2742
  ###########################################################################
@@ -18,7 +18,7 @@ class Default(ABC):
18
18
  pass
19
19
 
20
20
  @abstractmethod
21
- def python(self):
21
+ def python(self) -> t.Any:
22
22
  pass
23
23
 
24
24
  def get_postgres_interval_string(self, attributes: t.List[str]) -> str:
@@ -102,7 +102,15 @@ class DateCustom(Default):
102
102
 
103
103
 
104
104
  # Might add an enum back which encapsulates all of the options.
105
- DateArg = t.Union[DateOffset, DateCustom, DateNow, Enum, None, datetime.date]
105
+ DateArg = t.Union[
106
+ DateOffset,
107
+ DateCustom,
108
+ DateNow,
109
+ Enum,
110
+ None,
111
+ datetime.date,
112
+ t.Callable[[], datetime.date],
113
+ ]
106
114
 
107
115
 
108
116
  __all__ = ["DateArg", "DateOffset", "DateCustom", "DateNow"]
@@ -80,6 +80,7 @@ IntervalArg = t.Union[
80
80
  Enum,
81
81
  None,
82
82
  datetime.timedelta,
83
+ t.Callable[[], datetime.timedelta],
83
84
  ]
84
85
 
85
86
 
@@ -89,7 +89,15 @@ class TimeCustom(Default):
89
89
  )
90
90
 
91
91
 
92
- TimeArg = t.Union[TimeCustom, TimeNow, TimeOffset, Enum, None, datetime.time]
92
+ TimeArg = t.Union[
93
+ TimeCustom,
94
+ TimeNow,
95
+ TimeOffset,
96
+ Enum,
97
+ None,
98
+ datetime.time,
99
+ t.Callable[[], datetime.time],
100
+ ]
93
101
 
94
102
 
95
103
  __all__ = ["TimeArg", "TimeCustom", "TimeNow", "TimeOffset"]
@@ -138,6 +138,7 @@ TimestampArg = t.Union[
138
138
  None,
139
139
  datetime.datetime,
140
140
  DatetimeDefault,
141
+ t.Callable[[], datetime.datetime],
141
142
  ]
142
143
 
143
144
 
@@ -22,7 +22,7 @@ class UUID4(Default):
22
22
  return uuid.uuid4()
23
23
 
24
24
 
25
- UUIDArg = t.Union[UUID4, uuid.UUID, str, Enum, None]
25
+ UUIDArg = t.Union[UUID4, uuid.UUID, str, Enum, None, t.Callable[[], uuid.UUID]]
26
26
 
27
27
 
28
28
  __all__ = ["UUIDArg", "UUID4"]
@@ -131,6 +131,7 @@ class M2MSelect(Selectable):
131
131
  if len(self.columns) > 1 or not self.serialisation_safe:
132
132
  column_name = table_2_pk_name
133
133
  else:
134
+ assert len(self.columns) > 0
134
135
  column_name = self.columns[0]._meta.db_column_name
135
136
 
136
137
  return QueryString(
@@ -256,15 +257,14 @@ class M2MMeta:
256
257
 
257
258
  @dataclass
258
259
  class M2MAddRelated:
259
-
260
260
  target_row: Table
261
261
  m2m: M2M
262
262
  rows: t.Sequence[Table]
263
263
  extra_column_values: t.Dict[t.Union[Column, str], t.Any]
264
264
 
265
- def __post_init__(self) -> None:
266
- # Normalise `extra_column_values`, so we just have the column names.
267
- self.extra_column_values: t.Dict[str, t.Any] = {
265
+ @property
266
+ def resolved_extra_column_values(self) -> t.Dict[str, t.Any]:
267
+ return {
268
268
  i._meta.name if isinstance(i, Column) else i: j
269
269
  for i, j in self.extra_column_values.items()
270
270
  }
@@ -281,7 +281,9 @@ class M2MAddRelated:
281
281
  joining_table_rows = []
282
282
 
283
283
  for row in rows:
284
- joining_table_row = joining_table(**self.extra_column_values)
284
+ joining_table_row = joining_table(
285
+ **self.resolved_extra_column_values
286
+ )
285
287
  setattr(
286
288
  joining_table_row,
287
289
  self.m2m._meta.primary_foreign_key._meta.name,
@@ -323,7 +325,6 @@ class M2MAddRelated:
323
325
 
324
326
  @dataclass
325
327
  class M2MRemoveRelated:
326
-
327
328
  target_row: Table
328
329
  m2m: M2M
329
330
  rows: t.Sequence[Table]
@@ -363,7 +364,6 @@ class M2MRemoveRelated:
363
364
 
364
365
  @dataclass
365
366
  class M2MGetRelated:
366
-
367
367
  row: Table
368
368
  m2m: M2M
369
369
 
@@ -62,5 +62,9 @@ class ArrayAny(ComparisonOperator):
62
62
  template = "{value} = ANY ({name})"
63
63
 
64
64
 
65
+ class ArrayNotAny(ComparisonOperator):
66
+ template = "NOT {value} = ANY ({name})"
67
+
68
+
65
69
  class ArrayAll(ComparisonOperator):
66
70
  template = "{value} = ALL ({name})"
@@ -157,17 +157,22 @@ class AppConfig:
157
157
  """
158
158
 
159
159
  app_name: str
160
- migrations_folder_path: str
160
+ migrations_folder_path: t.Union[str, pathlib.Path]
161
161
  table_classes: t.List[t.Type[Table]] = field(default_factory=list)
162
162
  migration_dependencies: t.List[str] = field(default_factory=list)
163
163
  commands: t.List[t.Union[t.Callable, Command]] = field(
164
164
  default_factory=list
165
165
  )
166
166
 
167
- def __post_init__(self) -> None:
168
- if isinstance(self.migrations_folder_path, pathlib.Path):
169
- self.migrations_folder_path = str(self.migrations_folder_path)
167
+ @property
168
+ def resolved_migrations_folder_path(self) -> str:
169
+ return (
170
+ str(self.migrations_folder_path)
171
+ if isinstance(self.migrations_folder_path, pathlib.Path)
172
+ else self.migrations_folder_path
173
+ )
170
174
 
175
+ def __post_init__(self) -> None:
171
176
  self._migration_dependency_app_configs: t.Optional[
172
177
  t.List[AppConfig]
173
178
  ] = None
@@ -7,12 +7,14 @@ import string
7
7
  import typing as t
8
8
  from abc import ABCMeta, abstractmethod
9
9
 
10
+ from typing_extensions import Self
11
+
10
12
  from piccolo.querystring import QueryString
11
13
  from piccolo.utils.sync import run_sync
12
14
  from piccolo.utils.warnings import Level, colored_string, colored_warning
13
15
 
14
16
  if t.TYPE_CHECKING: # pragma: no cover
15
- from piccolo.query.base import Query
17
+ from piccolo.query.base import DDL, Query
16
18
 
17
19
 
18
20
  logger = logging.getLogger(__name__)
@@ -32,31 +34,76 @@ def validate_savepoint_name(savepoint_name: str) -> None:
32
34
  )
33
35
 
34
36
 
35
- class Batch:
36
- pass
37
+ class BaseBatch(metaclass=ABCMeta):
38
+ @abstractmethod
39
+ async def __aenter__(self: Self, *args, **kwargs) -> Self: ...
37
40
 
41
+ @abstractmethod
42
+ async def __aexit__(self, *args, **kwargs): ...
38
43
 
39
- TransactionClass = t.TypeVar("TransactionClass")
44
+ @abstractmethod
45
+ def __aiter__(self: Self) -> Self: ...
40
46
 
47
+ @abstractmethod
48
+ async def __anext__(self) -> t.List[t.Dict]: ...
41
49
 
42
- class Engine(t.Generic[TransactionClass], metaclass=ABCMeta):
43
50
 
44
- __slots__ = ("query_id",)
51
+ class BaseTransaction(metaclass=ABCMeta):
45
52
 
46
- def __init__(self):
47
- run_sync(self.check_version())
48
- run_sync(self.prep_database())
49
- self.query_id = 0
53
+ __slots__: t.Tuple[str, ...] = tuple()
50
54
 
51
- @property
52
55
  @abstractmethod
53
- def engine_type(self) -> str:
54
- pass
56
+ async def __aenter__(self, *args, **kwargs): ...
55
57
 
56
- @property
57
58
  @abstractmethod
58
- def min_version_number(self) -> float:
59
- pass
59
+ async def __aexit__(self, *args, **kwargs) -> bool: ...
60
+
61
+
62
+ class BaseAtomic(metaclass=ABCMeta):
63
+
64
+ __slots__: t.Tuple[str, ...] = tuple()
65
+
66
+ @abstractmethod
67
+ def add(self, *query: t.Union[Query, DDL]): ...
68
+
69
+ @abstractmethod
70
+ async def run(self): ...
71
+
72
+ @abstractmethod
73
+ def run_sync(self): ...
74
+
75
+ @abstractmethod
76
+ def __await__(self): ...
77
+
78
+
79
+ TransactionClass = t.TypeVar("TransactionClass", bound=BaseTransaction)
80
+
81
+
82
+ class Engine(t.Generic[TransactionClass], metaclass=ABCMeta):
83
+ __slots__ = (
84
+ "query_id",
85
+ "log_queries",
86
+ "log_responses",
87
+ "engine_type",
88
+ "min_version_number",
89
+ "current_transaction",
90
+ )
91
+
92
+ def __init__(
93
+ self,
94
+ engine_type: str,
95
+ min_version_number: t.Union[int, float],
96
+ log_queries: bool = False,
97
+ log_responses: bool = False,
98
+ ):
99
+ self.log_queries = log_queries
100
+ self.log_responses = log_responses
101
+ self.engine_type = engine_type
102
+ self.min_version_number = min_version_number
103
+
104
+ run_sync(self.check_version())
105
+ run_sync(self.prep_database())
106
+ self.query_id = 0
60
107
 
61
108
  @abstractmethod
62
109
  async def get_version(self) -> float:
@@ -76,11 +123,13 @@ class Engine(t.Generic[TransactionClass], metaclass=ABCMeta):
76
123
  query: Query,
77
124
  batch_size: int = 100,
78
125
  node: t.Optional[str] = None,
79
- ) -> Batch:
126
+ ) -> BaseBatch:
80
127
  pass
81
128
 
82
129
  @abstractmethod
83
- async def run_querystring(self, querystring: QueryString, in_pool: bool):
130
+ async def run_querystring(
131
+ self, querystring: QueryString, in_pool: bool = True
132
+ ):
84
133
  pass
85
134
 
86
135
  @abstractmethod
@@ -88,11 +137,11 @@ class Engine(t.Generic[TransactionClass], metaclass=ABCMeta):
88
137
  pass
89
138
 
90
139
  @abstractmethod
91
- def transaction(self):
140
+ def transaction(self, *args, **kwargs) -> TransactionClass:
92
141
  pass
93
142
 
94
143
  @abstractmethod
95
- def atomic(self):
144
+ def atomic(self) -> BaseAtomic:
96
145
  pass
97
146
 
98
147
  async def check_version(self):
@@ -16,9 +16,6 @@ class CockroachEngine(PostgresEngine):
16
16
  :class:`PostgresEngine <piccolo.engine.postgres.PostgresEngine>`.
17
17
  """
18
18
 
19
- engine_type = "cockroach"
20
- min_version_number = 0 # Doesn't seem to work with cockroach versioning.
21
-
22
19
  def __init__(
23
20
  self,
24
21
  config: t.Dict[str, t.Any],
@@ -34,6 +31,8 @@ class CockroachEngine(PostgresEngine):
34
31
  log_responses=log_responses,
35
32
  extra_nodes=extra_nodes,
36
33
  )
34
+ self.engine_type = "cockroach"
35
+ self.min_version_number = 0
37
36
 
38
37
  async def prep_database(self):
39
38
  try: