piccolo 0.108.0__tar.gz → 0.110.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 (356) hide show
  1. {piccolo-0.108.0 → piccolo-0.110.0}/PKG-INFO +2 -2
  2. {piccolo-0.108.0 → piccolo-0.110.0}/README.md +1 -1
  3. piccolo-0.110.0/piccolo/__init__.py +1 -0
  4. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/new.py +2 -3
  5. piccolo-0.108.0/piccolo/apps/asgi/commands/templates/app/_starlite_app.py.jinja → piccolo-0.110.0/piccolo/apps/asgi/commands/templates/app/_litestar_app.py.jinja +8 -8
  6. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/app.py.jinja +2 -4
  7. piccolo-0.108.0/piccolo/apps/asgi/commands/templates/app/home/_starlite_endpoints.py.jinja → piccolo-0.110.0/piccolo/apps/asgi/commands/templates/app/home/_litestar_endpoints.py.jinja +2 -1
  8. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja +2 -4
  9. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/home/templates/home.html.jinja_raw +1 -6
  10. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/playground/commands/run.py +24 -8
  11. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/base.py +45 -0
  12. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/column_types.py +2 -2
  13. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/select.py +25 -10
  14. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/mixins.py +77 -3
  15. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/testing/model_builder.py +9 -7
  16. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo.egg-info/PKG-INFO +2 -2
  17. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo.egg-info/SOURCES.txt +3 -4
  18. piccolo-0.110.0/tests/table/test_join_on.py +107 -0
  19. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_select.py +160 -1
  20. piccolo-0.108.0/piccolo/__init__.py +0 -1
  21. piccolo-0.108.0/piccolo/apps/asgi/commands/templates/app/_xpresso_app.py.jinja +0 -113
  22. piccolo-0.108.0/piccolo/apps/asgi/commands/templates/app/home/_xpresso_endpoints.py.jinja +0 -20
  23. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/__init__.py +0 -0
  24. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/app/__init__.py +0 -0
  25. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/app/commands/__init__.py +0 -0
  26. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/app/commands/new.py +0 -0
  27. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/app/commands/show_all.py +0 -0
  28. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/app/commands/templates/piccolo_app.py.jinja +0 -0
  29. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/app/commands/templates/tables.py.jinja +0 -0
  30. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/app/piccolo_app.py +0 -0
  31. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/__init__.py +0 -0
  32. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/__init__.py +0 -0
  33. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/README.md.jinja +0 -0
  34. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja +0 -0
  35. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja +0 -0
  36. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/_starlette_app.py.jinja +0 -0
  37. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/conftest.py.jinja +0 -0
  38. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/home/__init__.py.jinja +0 -0
  39. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/home/_blacksheep_endpoints.py.jinja +0 -0
  40. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/home/_starlette_endpoints.py.jinja +0 -0
  41. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/home/piccolo_app.py.jinja +0 -0
  42. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/home/piccolo_migrations/README.md +0 -0
  43. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/home/tables.py.jinja +0 -0
  44. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/home/templates/base.html.jinja_raw +0 -0
  45. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/main.py.jinja +0 -0
  46. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/piccolo_conf.py.jinja +0 -0
  47. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/piccolo_conf_test.py.jinja +0 -0
  48. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/requirements.txt.jinja +0 -0
  49. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/static/favicon.ico +0 -0
  50. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/commands/templates/app/static/main.css +0 -0
  51. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/asgi/piccolo_app.py +0 -0
  52. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/fixtures/__init__.py +0 -0
  53. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/fixtures/commands/__init__.py +0 -0
  54. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/fixtures/commands/dump.py +0 -0
  55. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/fixtures/commands/load.py +0 -0
  56. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/fixtures/commands/shared.py +0 -0
  57. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/fixtures/piccolo_app.py +0 -0
  58. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/meta/__init__.py +0 -0
  59. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/meta/commands/__init__.py +0 -0
  60. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/meta/commands/version.py +0 -0
  61. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/meta/piccolo_app.py +0 -0
  62. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/__init__.py +0 -0
  63. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/auto/__init__.py +0 -0
  64. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/auto/diffable_table.py +0 -0
  65. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/auto/migration_manager.py +0 -0
  66. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/auto/operations.py +0 -0
  67. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/auto/schema_differ.py +0 -0
  68. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/auto/schema_snapshot.py +0 -0
  69. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/auto/serialisation.py +0 -0
  70. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/auto/serialisation_legacy.py +0 -0
  71. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/commands/__init__.py +0 -0
  72. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/commands/backwards.py +0 -0
  73. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/commands/base.py +0 -0
  74. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/commands/check.py +0 -0
  75. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/commands/clean.py +0 -0
  76. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/commands/forwards.py +0 -0
  77. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/commands/new.py +0 -0
  78. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/commands/templates/migration.py.jinja +0 -0
  79. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/piccolo_app.py +0 -0
  80. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/migrations/tables.py +0 -0
  81. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/playground/__init__.py +0 -0
  82. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/playground/commands/__init__.py +0 -0
  83. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/playground/piccolo_app.py +0 -0
  84. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/project/__init__.py +0 -0
  85. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/project/commands/__init__.py +0 -0
  86. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/project/commands/new.py +0 -0
  87. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/project/commands/templates/piccolo_conf.py.jinja +0 -0
  88. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/project/piccolo_app.py +0 -0
  89. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/schema/__init__.py +0 -0
  90. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/schema/commands/__init__.py +0 -0
  91. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/schema/commands/exceptions.py +0 -0
  92. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/schema/commands/generate.py +0 -0
  93. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/schema/commands/graph.py +0 -0
  94. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/schema/commands/templates/graphviz.dot.jinja +0 -0
  95. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/schema/piccolo_app.py +0 -0
  96. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/shell/__init__.py +0 -0
  97. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/shell/commands/__init__.py +0 -0
  98. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/shell/commands/run.py +0 -0
  99. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/shell/piccolo_app.py +0 -0
  100. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/sql_shell/__init__.py +0 -0
  101. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/sql_shell/commands/__init__.py +0 -0
  102. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/sql_shell/commands/run.py +0 -0
  103. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/sql_shell/piccolo_app.py +0 -0
  104. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/tester/__init__.py +0 -0
  105. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/tester/commands/__init__.py +0 -0
  106. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/tester/commands/run.py +0 -0
  107. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/tester/piccolo_app.py +0 -0
  108. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/user/__init__.py +0 -0
  109. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/user/commands/__init__.py +0 -0
  110. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/user/commands/change_password.py +0 -0
  111. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/user/commands/change_permissions.py +0 -0
  112. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/user/commands/create.py +0 -0
  113. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/user/piccolo_app.py +0 -0
  114. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/user/piccolo_migrations/2019-11-14T21-52-21.py +0 -0
  115. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/user/piccolo_migrations/2020-06-11T21-38-55.py +0 -0
  116. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/user/piccolo_migrations/2021-04-30T16-14-15.py +0 -0
  117. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/user/piccolo_migrations/__init__.py +0 -0
  118. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/apps/user/tables.py +0 -0
  119. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/__init__.py +0 -0
  120. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/choices.py +0 -0
  121. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/combination.py +0 -0
  122. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/defaults/__init__.py +0 -0
  123. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/defaults/base.py +0 -0
  124. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/defaults/date.py +0 -0
  125. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/defaults/interval.py +0 -0
  126. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/defaults/time.py +0 -0
  127. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/defaults/timestamp.py +0 -0
  128. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/defaults/timestamptz.py +0 -0
  129. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/defaults/uuid.py +0 -0
  130. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/indexes.py +0 -0
  131. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/m2m.py +0 -0
  132. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/operators/__init__.py +0 -0
  133. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/operators/base.py +0 -0
  134. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/operators/comparison.py +0 -0
  135. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/operators/math.py +0 -0
  136. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/operators/string.py +0 -0
  137. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/readable.py +0 -0
  138. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/columns/reference.py +0 -0
  139. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/conf/__init__.py +0 -0
  140. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/conf/apps.py +0 -0
  141. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/custom_types.py +0 -0
  142. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/engine/__init__.py +0 -0
  143. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/engine/base.py +0 -0
  144. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/engine/cockroach.py +0 -0
  145. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/engine/exceptions.py +0 -0
  146. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/engine/finder.py +0 -0
  147. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/engine/postgres.py +0 -0
  148. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/engine/sqlite.py +0 -0
  149. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/main.py +0 -0
  150. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/py.typed +0 -0
  151. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/__init__.py +0 -0
  152. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/base.py +0 -0
  153. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/__init__.py +0 -0
  154. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/alter.py +0 -0
  155. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/count.py +0 -0
  156. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/create.py +0 -0
  157. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/create_index.py +0 -0
  158. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/delete.py +0 -0
  159. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/drop_index.py +0 -0
  160. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/exists.py +0 -0
  161. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/indexes.py +0 -0
  162. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/insert.py +0 -0
  163. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/objects.py +0 -0
  164. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/raw.py +0 -0
  165. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/refresh.py +0 -0
  166. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/table_exists.py +0 -0
  167. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/methods/update.py +0 -0
  168. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/query/proxy.py +0 -0
  169. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/querystring.py +0 -0
  170. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/table.py +0 -0
  171. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/table_reflection.py +0 -0
  172. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/testing/__init__.py +0 -0
  173. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/testing/random_builder.py +0 -0
  174. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/__init__.py +0 -0
  175. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/dictionary.py +0 -0
  176. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/encoding.py +0 -0
  177. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/graphlib/__init__.py +0 -0
  178. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/graphlib/_graphlib.py +0 -0
  179. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/lazy_loader.py +0 -0
  180. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/list.py +0 -0
  181. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/naming.py +0 -0
  182. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/objects.py +0 -0
  183. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/printing.py +0 -0
  184. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/pydantic.py +0 -0
  185. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/repr.py +0 -0
  186. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/sql_values.py +0 -0
  187. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/sync.py +0 -0
  188. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo/utils/warnings.py +0 -0
  189. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo.egg-info/dependency_links.txt +0 -0
  190. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo.egg-info/entry_points.txt +0 -0
  191. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo.egg-info/requires.txt +0 -0
  192. {piccolo-0.108.0 → piccolo-0.110.0}/piccolo.egg-info/top_level.txt +0 -0
  193. {piccolo-0.108.0 → piccolo-0.110.0}/profiling/__init__.py +0 -0
  194. {piccolo-0.108.0 → piccolo-0.110.0}/profiling/run_profile.py +0 -0
  195. {piccolo-0.108.0 → piccolo-0.110.0}/pyproject.toml +0 -0
  196. {piccolo-0.108.0 → piccolo-0.110.0}/setup.cfg +0 -0
  197. {piccolo-0.108.0 → piccolo-0.110.0}/setup.py +0 -0
  198. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/__init__.py +0 -0
  199. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/app/__init__.py +0 -0
  200. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/app/commands/__init__.py +0 -0
  201. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/app/commands/test_new.py +0 -0
  202. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/app/commands/test_show_all.py +0 -0
  203. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/asgi/__init__.py +0 -0
  204. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/asgi/commands/__init__.py +0 -0
  205. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/asgi/commands/test_new.py +0 -0
  206. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/fixtures/__init__.py +0 -0
  207. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/fixtures/commands/__init__.py +0 -0
  208. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/fixtures/commands/test_dump_load.py +0 -0
  209. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/fixtures/commands/test_shared.py +0 -0
  210. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/meta/__init__.py +0 -0
  211. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/meta/commands/__init__.py +0 -0
  212. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/meta/commands/test_version.py +0 -0
  213. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/__init__.py +0 -0
  214. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/auto/__init__.py +0 -0
  215. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/auto/integration/__init__.py +0 -0
  216. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/auto/integration/test_migrations.py +0 -0
  217. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/auto/test_diffable_table.py +0 -0
  218. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/auto/test_migration_manager.py +0 -0
  219. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/auto/test_schema_differ.py +0 -0
  220. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/auto/test_schema_snapshot.py +0 -0
  221. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/auto/test_serialisation.py +0 -0
  222. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/commands/__init__.py +0 -0
  223. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/commands/test_base.py +0 -0
  224. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/commands/test_check.py +0 -0
  225. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/commands/test_clean.py +0 -0
  226. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/commands/test_forwards_backwards.py +0 -0
  227. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/commands/test_migrations/2020-03-31T20-38-22.py +0 -0
  228. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/commands/test_migrations/__init__.py +0 -0
  229. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/commands/test_new.py +0 -0
  230. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/migrations/test_migration.py +0 -0
  231. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/project/__init__.py +0 -0
  232. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/project/commands/__init__.py +0 -0
  233. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/project/commands/test_new.py +0 -0
  234. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/schema/__init__.py +0 -0
  235. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/shell/__init__.py +0 -0
  236. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/shell/commands/__init__.py +0 -0
  237. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/shell/commands/test_run.py +0 -0
  238. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/sql_shell/__init__.py +0 -0
  239. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/sql_shell/commands/__init__.py +0 -0
  240. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/sql_shell/commands/test_run.py +0 -0
  241. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/tester/__init__.py +0 -0
  242. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/user/__init__.py +0 -0
  243. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/user/commands/__init__.py +0 -0
  244. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/user/commands/test_change_password.py +0 -0
  245. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/user/commands/test_change_permissions.py +0 -0
  246. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/user/commands/test_create.py +0 -0
  247. {piccolo-0.108.0 → piccolo-0.110.0}/tests/apps/user/test_tables.py +0 -0
  248. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/__init__.py +0 -0
  249. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_array.py +0 -0
  250. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_base.py +0 -0
  251. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_bigint.py +0 -0
  252. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_boolean.py +0 -0
  253. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_bytea.py +0 -0
  254. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_choices.py +0 -0
  255. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_combination.py +0 -0
  256. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_date.py +0 -0
  257. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_db_column_name.py +0 -0
  258. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_defaults.py +0 -0
  259. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_double_precision.py +0 -0
  260. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_interval.py +0 -0
  261. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_json.py +0 -0
  262. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_jsonb.py +0 -0
  263. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_m2m.py +0 -0
  264. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_numeric.py +0 -0
  265. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_primary_key.py +0 -0
  266. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_readable.py +0 -0
  267. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_real.py +0 -0
  268. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_reference.py +0 -0
  269. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_reserved_column_names.py +0 -0
  270. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_smallint.py +0 -0
  271. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_time.py +0 -0
  272. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_timestamp.py +0 -0
  273. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_timestamptz.py +0 -0
  274. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_uuid.py +0 -0
  275. {piccolo-0.108.0 → piccolo-0.110.0}/tests/columns/test_varchar.py +0 -0
  276. {piccolo-0.108.0 → piccolo-0.110.0}/tests/conf/__init__.py +0 -0
  277. {piccolo-0.108.0 → piccolo-0.110.0}/tests/conf/example.py +0 -0
  278. {piccolo-0.108.0 → piccolo-0.110.0}/tests/conf/test_apps.py +0 -0
  279. {piccolo-0.108.0 → piccolo-0.110.0}/tests/engine/__init__.py +0 -0
  280. {piccolo-0.108.0 → piccolo-0.110.0}/tests/engine/test_extra_nodes.py +0 -0
  281. {piccolo-0.108.0 → piccolo-0.110.0}/tests/engine/test_logging.py +0 -0
  282. {piccolo-0.108.0 → piccolo-0.110.0}/tests/engine/test_nested_transaction.py +0 -0
  283. {piccolo-0.108.0 → piccolo-0.110.0}/tests/engine/test_pool.py +0 -0
  284. {piccolo-0.108.0 → piccolo-0.110.0}/tests/engine/test_transaction.py +0 -0
  285. {piccolo-0.108.0 → piccolo-0.110.0}/tests/engine/test_version_parsing.py +0 -0
  286. {piccolo-0.108.0 → piccolo-0.110.0}/tests/example_apps/__init__.py +0 -0
  287. {piccolo-0.108.0 → piccolo-0.110.0}/tests/example_apps/mega/__init__.py +0 -0
  288. {piccolo-0.108.0 → piccolo-0.110.0}/tests/example_apps/mega/piccolo_app.py +0 -0
  289. {piccolo-0.108.0 → piccolo-0.110.0}/tests/example_apps/mega/piccolo_migrations/2021-09-20T21-23-25-698988.py +0 -0
  290. {piccolo-0.108.0 → piccolo-0.110.0}/tests/example_apps/mega/piccolo_migrations/__init__.py +0 -0
  291. {piccolo-0.108.0 → piccolo-0.110.0}/tests/example_apps/mega/tables.py +0 -0
  292. {piccolo-0.108.0 → piccolo-0.110.0}/tests/example_apps/music/__init__.py +0 -0
  293. {piccolo-0.108.0 → piccolo-0.110.0}/tests/example_apps/music/piccolo_app.py +0 -0
  294. {piccolo-0.108.0 → piccolo-0.110.0}/tests/example_apps/music/tables.py +0 -0
  295. {piccolo-0.108.0 → piccolo-0.110.0}/tests/example_apps/music/tables_detailed.py +0 -0
  296. {piccolo-0.108.0 → piccolo-0.110.0}/tests/query/__init__.py +0 -0
  297. {piccolo-0.108.0 → piccolo-0.110.0}/tests/query/mixins/__init__.py +0 -0
  298. {piccolo-0.108.0 → piccolo-0.110.0}/tests/query/mixins/test_columns_delegate.py +0 -0
  299. {piccolo-0.108.0 → piccolo-0.110.0}/tests/query/mixins/test_order_by_delegate.py +0 -0
  300. {piccolo-0.108.0 → piccolo-0.110.0}/tests/query/test_await.py +0 -0
  301. {piccolo-0.108.0 → piccolo-0.110.0}/tests/query/test_camelcase.py +0 -0
  302. {piccolo-0.108.0 → piccolo-0.110.0}/tests/query/test_freeze.py +0 -0
  303. {piccolo-0.108.0 → piccolo-0.110.0}/tests/query/test_gather.py +0 -0
  304. {piccolo-0.108.0 → piccolo-0.110.0}/tests/query/test_querystring.py +0 -0
  305. {piccolo-0.108.0 → piccolo-0.110.0}/tests/query/test_slots.py +0 -0
  306. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/__init__.py +0 -0
  307. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/instance/__init__.py +0 -0
  308. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/instance/test_create.py +0 -0
  309. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/instance/test_get_related.py +0 -0
  310. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/instance/test_get_related_readable.py +0 -0
  311. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/instance/test_instantiate.py +0 -0
  312. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/instance/test_remove.py +0 -0
  313. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/instance/test_save.py +0 -0
  314. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/instance/test_to_dict.py +0 -0
  315. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_all_columns.py +0 -0
  316. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_alter.py +0 -0
  317. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_batch.py +0 -0
  318. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_callback.py +0 -0
  319. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_constructor.py +0 -0
  320. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_count.py +0 -0
  321. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_create.py +0 -0
  322. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_create_db_tables.py +0 -0
  323. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_create_table_class.py +0 -0
  324. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_delete.py +0 -0
  325. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_drop_db_tables.py +0 -0
  326. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_exists.py +0 -0
  327. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_from_dict.py +0 -0
  328. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_indexes.py +0 -0
  329. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_inheritance.py +0 -0
  330. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_insert.py +0 -0
  331. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_join.py +0 -0
  332. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_metaclass.py +0 -0
  333. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_objects.py +0 -0
  334. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_output.py +0 -0
  335. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_raw.py +0 -0
  336. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_ref.py +0 -0
  337. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_refresh.py +0 -0
  338. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_repr.py +0 -0
  339. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_str.py +0 -0
  340. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_table_exists.py +0 -0
  341. {piccolo-0.108.0 → piccolo-0.110.0}/tests/table/test_update.py +0 -0
  342. {piccolo-0.108.0 → piccolo-0.110.0}/tests/testing/__init__.py +0 -0
  343. {piccolo-0.108.0 → piccolo-0.110.0}/tests/testing/test_model_builder.py +0 -0
  344. {piccolo-0.108.0 → piccolo-0.110.0}/tests/testing/test_random_builder.py +0 -0
  345. {piccolo-0.108.0 → piccolo-0.110.0}/tests/utils/__init__.py +0 -0
  346. {piccolo-0.108.0 → piccolo-0.110.0}/tests/utils/test_dictionary.py +0 -0
  347. {piccolo-0.108.0 → piccolo-0.110.0}/tests/utils/test_encoding.py +0 -0
  348. {piccolo-0.108.0 → piccolo-0.110.0}/tests/utils/test_lazy_loader.py +0 -0
  349. {piccolo-0.108.0 → piccolo-0.110.0}/tests/utils/test_list.py +0 -0
  350. {piccolo-0.108.0 → piccolo-0.110.0}/tests/utils/test_naming.py +0 -0
  351. {piccolo-0.108.0 → piccolo-0.110.0}/tests/utils/test_printing.py +0 -0
  352. {piccolo-0.108.0 → piccolo-0.110.0}/tests/utils/test_pydantic.py +0 -0
  353. {piccolo-0.108.0 → piccolo-0.110.0}/tests/utils/test_sql_values.py +0 -0
  354. {piccolo-0.108.0 → piccolo-0.110.0}/tests/utils/test_sync.py +0 -0
  355. {piccolo-0.108.0 → piccolo-0.110.0}/tests/utils/test_table_reflection.py +0 -0
  356. {piccolo-0.108.0 → piccolo-0.110.0}/tests/utils/test_warnings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: piccolo
3
- Version: 0.108.0
3
+ Version: 0.110.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
@@ -105,7 +105,7 @@ Description: ![Logo](https://raw.githubusercontent.com/piccolo-orm/piccolo/maste
105
105
  piccolo asgi new
106
106
  ```
107
107
 
108
- [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/), [Xpresso](https://xpresso-api.dev/) and [Starlite](https://starlite-api.github.io/starlite/) are currently supported.
108
+ [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/) and [Litestar](https://litestar.dev/) are currently supported.
109
109
 
110
110
  ## Are you a Django user?
111
111
 
@@ -94,7 +94,7 @@ Let Piccolo scaffold you an ASGI web app, using Piccolo as the ORM:
94
94
  piccolo asgi new
95
95
  ```
96
96
 
97
- [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/), [Xpresso](https://xpresso-api.dev/) and [Starlite](https://starlite-api.github.io/starlite/) are currently supported.
97
+ [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/) and [Litestar](https://litestar.dev/) are currently supported.
98
98
 
99
99
  ## Are you a Django user?
100
100
 
@@ -0,0 +1 @@
1
+ __VERSION__ = "0.110.0"
@@ -10,10 +10,9 @@ from jinja2 import Environment, FileSystemLoader
10
10
 
11
11
  TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), "templates/app/")
12
12
  SERVERS = ["uvicorn", "Hypercorn"]
13
- ROUTERS = ["starlette", "fastapi", "blacksheep", "xpresso", "starlite"]
13
+ ROUTERS = ["starlette", "fastapi", "blacksheep", "litestar"]
14
14
  ROUTER_DEPENDENCIES = {
15
- "starlite": ["starlite>=1.46.0"],
16
- "xpresso": ["xpresso==0.43.0", "di==0.72.1"],
15
+ "litestar": ["litestar>=2.0.0a3"],
17
16
  }
18
17
 
19
18
 
@@ -2,13 +2,13 @@ import typing as t
2
2
 
3
3
  from piccolo.engine import engine_finder
4
4
  from piccolo_admin.endpoints import create_admin
5
- from starlite import Starlite, asgi, delete, get, patch, post
6
- from starlite.config.static_files import StaticFilesConfig
7
- from starlite.config.template import TemplateConfig
8
- from starlite.contrib.jinja import JinjaTemplateEngine
9
- from starlite.exceptions import NotFoundException
10
- from starlite.plugins.piccolo_orm import PiccoloORMPlugin
11
- from starlite.types import Receive, Scope, Send
5
+ from litestar import Litestar, asgi, delete, get, patch, post
6
+ from litestar.static_files import StaticFilesConfig
7
+ from litestar.template import TemplateConfig
8
+ from litestar.contrib.jinja import JinjaTemplateEngine
9
+ from litestar.contrib.piccolo_orm import PiccoloORMPlugin
10
+ from litestar.exceptions import NotFoundException
11
+ from litestar.types import Receive, Scope, Send
12
12
 
13
13
  from home.endpoints import home
14
14
  from home.piccolo_app import APP_CONFIG
@@ -71,7 +71,7 @@ async def close_database_connection_pool():
71
71
  print("Unable to connect to the database")
72
72
 
73
73
 
74
- app = Starlite(
74
+ app = Litestar(
75
75
  route_handlers=[
76
76
  admin,
77
77
  home,
@@ -4,8 +4,6 @@
4
4
  {% include '_starlette_app.py.jinja' %}
5
5
  {% elif router == 'blacksheep' %}
6
6
  {% include '_blacksheep_app.py.jinja' %}
7
- {% elif router == 'xpresso' %}
8
- {% include '_xpresso_app.py.jinja' %}
9
- {% elif router == 'starlite' %}
10
- {% include '_starlite_app.py.jinja' %}
7
+ {% elif router == 'litestar' %}
8
+ {% include '_litestar_app.py.jinja' %}
11
9
  {% endif %}
@@ -1,7 +1,7 @@
1
1
  import os
2
2
 
3
3
  import jinja2
4
- from starlite import MediaType, Request, Response, get
4
+ from litestar import MediaType, Request, Response, get
5
5
 
6
6
  ENVIRONMENT = jinja2.Environment(
7
7
  loader=jinja2.FileSystemLoader(
@@ -19,3 +19,4 @@ def home(request: Request) -> Response:
19
19
  media_type=MediaType.HTML,
20
20
  status_code=200,
21
21
  )
22
+
@@ -2,8 +2,6 @@
2
2
  {% include '_starlette_endpoints.py.jinja' %}
3
3
  {% elif router == 'blacksheep' %}
4
4
  {% include '_blacksheep_endpoints.py.jinja' %}
5
- {% elif router == 'xpresso' %}
6
- {% include '_xpresso_endpoints.py.jinja' %}
7
- {% elif router == 'starlite' %}
8
- {% include '_starlite_endpoints.py.jinja' %}
5
+ {% elif router == 'litestar' %}
6
+ {% include '_litestar_endpoints.py.jinja' %}
9
7
  {% endif %}
@@ -51,12 +51,7 @@
51
51
  <li><a href="/admin/">Admin</a></li>
52
52
  <li><a href="/docs/">Swagger API</a></li>
53
53
  </ul>
54
- <h3>Xpresso</h3>
55
- <ul>
56
- <li><a href="/admin/">Admin</a></li>
57
- <li><a href="/docs/">Swagger API</a></li>
58
- </ul>
59
- <h3>Starlite</h3>
54
+ <h3>Litestar</h3>
60
55
  <ul>
61
56
  <li><a href="/admin/">Admin</a></li>
62
57
  <li><a href="/schema/swagger">Swagger API</a></li>
@@ -136,8 +136,7 @@ def populate():
136
136
  """
137
137
  for _table in reversed(TABLES):
138
138
  try:
139
- if _table.table_exists().run_sync():
140
- _table.alter().drop_table().run_sync()
139
+ _table.alter().drop_table(if_exists=True).run_sync()
141
140
  except Exception as e:
142
141
  print(e)
143
142
 
@@ -180,13 +179,30 @@ def populate():
180
179
  ticket = Ticket(concert=concert.id, price=Decimal("50.0"))
181
180
  ticket.save().run_sync()
182
181
 
183
- discount_code = DiscountCode(code=uuid.uuid4())
184
- discount_code.save().run_sync()
182
+ DiscountCode.insert(
183
+ *[DiscountCode({DiscountCode.code: uuid.uuid4()}) for _ in range(5)]
184
+ ).run_sync()
185
185
 
186
- recording_studio = RecordingStudio(
187
- name="Abbey Road", facilities={"restaurant": True, "mixing_desk": True}
188
- )
189
- recording_studio.save().run_sync()
186
+ RecordingStudio.insert(
187
+ RecordingStudio(
188
+ {
189
+ RecordingStudio.name: "Abbey Road",
190
+ RecordingStudio.facilities: {
191
+ "restaurant": True,
192
+ "mixing_desk": True,
193
+ },
194
+ }
195
+ ),
196
+ RecordingStudio(
197
+ {
198
+ RecordingStudio.name: "Electric Lady",
199
+ RecordingStudio.facilities: {
200
+ "restaurant": False,
201
+ "mixing_desk": True,
202
+ },
203
+ },
204
+ ),
205
+ ).run_sync()
190
206
 
191
207
 
192
208
  def run(
@@ -759,6 +759,51 @@ class Column(Selectable):
759
759
  column._alias = name
760
760
  return column
761
761
 
762
+ def join_on(self, column: Column) -> ForeignKey:
763
+ """
764
+ Joins are typically performed via foreign key columns. For example,
765
+ here we get the band's name and the manager's name::
766
+
767
+ class Manager(Table):
768
+ name = Varchar()
769
+
770
+ class Band(Table):
771
+ name = Varchar()
772
+ manager = ForeignKey(Manager)
773
+
774
+ >>> await Band.select(Band.name, Band.manager.name)
775
+
776
+ The ``join_on`` method lets you join tables even when foreign keys
777
+ don't exist, by joining on a column in another table.
778
+
779
+ For example, here we want to get the manager's email, but no foreign
780
+ key exists::
781
+
782
+ class Manager(Table):
783
+ name = Varchar(unique=True)
784
+ email = Varchar()
785
+
786
+ class Band(Table):
787
+ name = Varchar()
788
+ manager_name = Varchar()
789
+
790
+ >>> await Band.select(
791
+ ... Band.name,
792
+ ... Band.manager_name.join_on(Manager.name).email
793
+ ... )
794
+
795
+ """
796
+ from piccolo.columns.column_types import ForeignKey
797
+
798
+ virtual_foreign_key = ForeignKey(
799
+ references=column._meta.table, target_column=column
800
+ )
801
+ virtual_foreign_key._meta._name = self._meta.name
802
+ virtual_foreign_key._meta.call_chain = [*self._meta.call_chain]
803
+ virtual_foreign_key._meta._table = self._meta.table
804
+ virtual_foreign_key.set_proxy_columns()
805
+ return virtual_foreign_key
806
+
762
807
  def get_default_value(self) -> t.Any:
763
808
  """
764
809
  If the column has a default attribute, return it. If it's callable,
@@ -1784,7 +1784,7 @@ class ForeignKey(Column):
1784
1784
 
1785
1785
  :param on_update:
1786
1786
  Determines what the database should do when a row has it's primary key
1787
- updated. If set to ``OnDelete.cascade``, any rows referencing the
1787
+ updated. If set to ``OnUpdate.cascade``, any rows referencing the
1788
1788
  updated row will have their references updated to point to the new
1789
1789
  primary key.
1790
1790
 
@@ -1800,7 +1800,7 @@ class ForeignKey(Column):
1800
1800
 
1801
1801
  .. code-block:: python
1802
1802
 
1803
- from piccolo.columns import OnDelete
1803
+ from piccolo.columns import OnUpdate
1804
1804
 
1805
1805
  class Band(Table):
1806
1806
  name = ForeignKey(
@@ -353,8 +353,18 @@ class Select(Query[TableInstance, t.List[t.Dict[str, t.Any]]]):
353
353
  self.columns_delegate.columns(*_columns)
354
354
  return self
355
355
 
356
- def distinct(self: Self) -> Self:
357
- self.distinct_delegate.distinct()
356
+ def distinct(
357
+ self: Self, *, on: t.Optional[t.Sequence[Column]] = None
358
+ ) -> Self:
359
+ if on is not None and self.engine_type not in (
360
+ "postgres",
361
+ "cockroach",
362
+ ):
363
+ raise ValueError(
364
+ "Only Postgres and Cockroach supports DISTINCT ON"
365
+ )
366
+
367
+ self.distinct_delegate.distinct(enabled=True, on=on)
358
368
  return self
359
369
 
360
370
  def group_by(self: Self, *columns: t.Union[Column, str]) -> Self:
@@ -722,17 +732,22 @@ class Select(Query[TableInstance, t.List[t.Dict[str, t.Any]]]):
722
732
 
723
733
  #######################################################################
724
734
 
725
- select = (
726
- "SELECT DISTINCT" if self.distinct_delegate._distinct else "SELECT"
727
- )
728
- query = f"{select} {columns_str} FROM {self.table._meta.tablename}"
735
+ args: t.List[t.Any] = []
729
736
 
730
- for join in joins:
731
- query += f" {join}"
737
+ query = "SELECT"
732
738
 
733
- #######################################################################
739
+ distinct = self.distinct_delegate._distinct
740
+ if distinct:
741
+ if distinct.on:
742
+ distinct.validate_on(self.order_by_delegate._order_by)
734
743
 
735
- args: t.List[t.Any] = []
744
+ query += "{}"
745
+ args.append(distinct.querystring)
746
+
747
+ query += f" {columns_str} FROM {self.table._meta.tablename}"
748
+
749
+ for join in joins:
750
+ query += f" {join}"
736
751
 
737
752
  if self.as_of_delegate._as_of:
738
753
  query += "{}"
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import asyncio
4
+ import collections.abc
4
5
  import itertools
5
6
  import typing as t
6
7
  from dataclasses import dataclass, field
@@ -18,6 +19,70 @@ if t.TYPE_CHECKING: # pragma: no cover
18
19
  from piccolo.table import Table # noqa
19
20
 
20
21
 
22
+ class DistinctOnError(ValueError):
23
+ """
24
+ Raised when ``DISTINCT ON`` queries are malformed.
25
+ """
26
+
27
+ pass
28
+
29
+
30
+ @dataclass
31
+ class Distinct:
32
+ __slots__ = ("enabled", "on")
33
+
34
+ enabled: bool
35
+ on: t.Optional[t.Sequence[Column]]
36
+
37
+ @property
38
+ def querystring(self) -> QueryString:
39
+ if self.enabled:
40
+ if self.on:
41
+ column_names = ", ".join(
42
+ i._meta.get_full_name(with_alias=False) for i in self.on
43
+ )
44
+ return QueryString(f" DISTINCT ON ({column_names})")
45
+ else:
46
+ return QueryString(" DISTINCT")
47
+ else:
48
+ return QueryString(" ALL")
49
+
50
+ def validate_on(self, order_by: OrderBy):
51
+ """
52
+ When using the `on` argument, the first column must match the first
53
+ order by column.
54
+
55
+ :raises DistinctOnError:
56
+ If the columns don't match.
57
+
58
+ """
59
+ validated = True
60
+
61
+ try:
62
+ first_order_column = order_by.order_by_items[0].columns[0]
63
+ except IndexError:
64
+ validated = False
65
+ else:
66
+ if not self.on:
67
+ validated = False
68
+ elif isinstance(first_order_column, Column) and not self.on[
69
+ 0
70
+ ]._equals(first_order_column):
71
+ validated = False
72
+
73
+ if not validated:
74
+ raise DistinctOnError(
75
+ "The first `order_by` column must match the first column "
76
+ "passed to `on`."
77
+ )
78
+
79
+ def __str__(self) -> str:
80
+ return self.querystring.__str__()
81
+
82
+ def copy(self) -> Distinct:
83
+ return self.__class__(enabled=self.enabled, on=self.on)
84
+
85
+
21
86
  @dataclass
22
87
  class Limit:
23
88
  __slots__ = ("number",)
@@ -259,10 +324,19 @@ class AsOfDelegate:
259
324
  @dataclass
260
325
  class DistinctDelegate:
261
326
 
262
- _distinct: bool = False
327
+ _distinct: Distinct = field(
328
+ default_factory=lambda: Distinct(enabled=False, on=None)
329
+ )
330
+
331
+ def distinct(
332
+ self, enabled: bool, on: t.Optional[t.Sequence[Column]] = None
333
+ ):
334
+ if on and not isinstance(on, collections.abc.Sequence):
335
+ # Check a sequence is passed in, otherwise the user will get some
336
+ # unuseful errors later on.
337
+ raise ValueError("`on` must be a sequence of `Column` instances")
263
338
 
264
- def distinct(self):
265
- self._distinct = True
339
+ self._distinct = Distinct(enabled=enabled, on=on)
266
340
 
267
341
 
268
342
  @dataclass
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  import json
2
4
  import typing as t
3
5
  from datetime import date, datetime, time, timedelta
@@ -5,7 +7,7 @@ from decimal import Decimal
5
7
  from uuid import UUID
6
8
 
7
9
  from piccolo.columns import Array, Column
8
- from piccolo.table import Table
10
+ from piccolo.custom_types import TableInstance
9
11
  from piccolo.testing.random_builder import RandomBuilder
10
12
  from piccolo.utils.sync import run_sync
11
13
 
@@ -27,11 +29,11 @@ class ModelBuilder:
27
29
  @classmethod
28
30
  async def build(
29
31
  cls,
30
- table_class: t.Type[Table],
32
+ table_class: t.Type[TableInstance],
31
33
  defaults: t.Dict[t.Union[Column, str], t.Any] = None,
32
34
  persist: bool = True,
33
35
  minimal: bool = False,
34
- ) -> Table:
36
+ ) -> TableInstance:
35
37
  """
36
38
  Build a ``Table`` instance with random data and save async.
37
39
  If the ``Table`` has any foreign keys, then the related rows are also
@@ -78,11 +80,11 @@ class ModelBuilder:
78
80
  @classmethod
79
81
  def build_sync(
80
82
  cls,
81
- table_class: t.Type[Table],
83
+ table_class: t.Type[TableInstance],
82
84
  defaults: t.Dict[t.Union[Column, str], t.Any] = None,
83
85
  persist: bool = True,
84
86
  minimal: bool = False,
85
- ) -> Table:
87
+ ) -> TableInstance:
86
88
  """
87
89
  A sync wrapper around :meth:`build`.
88
90
  """
@@ -98,11 +100,11 @@ class ModelBuilder:
98
100
  @classmethod
99
101
  async def _build(
100
102
  cls,
101
- table_class: t.Type[Table],
103
+ table_class: t.Type[TableInstance],
102
104
  defaults: t.Dict[t.Union[Column, str], t.Any] = None,
103
105
  minimal: bool = False,
104
106
  persist: bool = True,
105
- ) -> Table:
107
+ ) -> TableInstance:
106
108
  model = table_class(_ignore_missing=True)
107
109
  defaults = {} if not defaults else defaults
108
110
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: piccolo
3
- Version: 0.108.0
3
+ Version: 0.110.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
@@ -105,7 +105,7 @@ Description: ![Logo](https://raw.githubusercontent.com/piccolo-orm/piccolo/maste
105
105
  piccolo asgi new
106
106
  ```
107
107
 
108
- [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/), [Xpresso](https://xpresso-api.dev/) and [Starlite](https://starlite-api.github.io/starlite/) are currently supported.
108
+ [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/) and [Litestar](https://litestar.dev/) are currently supported.
109
109
 
110
110
  ## Are you a Django user?
111
111
 
@@ -29,9 +29,8 @@ piccolo/apps/asgi/commands/new.py
29
29
  piccolo/apps/asgi/commands/templates/app/README.md.jinja
30
30
  piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja
31
31
  piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja
32
+ piccolo/apps/asgi/commands/templates/app/_litestar_app.py.jinja
32
33
  piccolo/apps/asgi/commands/templates/app/_starlette_app.py.jinja
33
- piccolo/apps/asgi/commands/templates/app/_starlite_app.py.jinja
34
- piccolo/apps/asgi/commands/templates/app/_xpresso_app.py.jinja
35
34
  piccolo/apps/asgi/commands/templates/app/app.py.jinja
36
35
  piccolo/apps/asgi/commands/templates/app/conftest.py.jinja
37
36
  piccolo/apps/asgi/commands/templates/app/main.py.jinja
@@ -40,9 +39,8 @@ piccolo/apps/asgi/commands/templates/app/piccolo_conf_test.py.jinja
40
39
  piccolo/apps/asgi/commands/templates/app/requirements.txt.jinja
41
40
  piccolo/apps/asgi/commands/templates/app/home/__init__.py.jinja
42
41
  piccolo/apps/asgi/commands/templates/app/home/_blacksheep_endpoints.py.jinja
42
+ piccolo/apps/asgi/commands/templates/app/home/_litestar_endpoints.py.jinja
43
43
  piccolo/apps/asgi/commands/templates/app/home/_starlette_endpoints.py.jinja
44
- piccolo/apps/asgi/commands/templates/app/home/_starlite_endpoints.py.jinja
45
- piccolo/apps/asgi/commands/templates/app/home/_xpresso_endpoints.py.jinja
46
44
  piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja
47
45
  piccolo/apps/asgi/commands/templates/app/home/piccolo_app.py.jinja
48
46
  piccolo/apps/asgi/commands/templates/app/home/tables.py.jinja
@@ -316,6 +314,7 @@ tests/table/test_indexes.py
316
314
  tests/table/test_inheritance.py
317
315
  tests/table/test_insert.py
318
316
  tests/table/test_join.py
317
+ tests/table/test_join_on.py
319
318
  tests/table/test_metaclass.py
320
319
  tests/table/test_objects.py
321
320
  tests/table/test_output.py
@@ -0,0 +1,107 @@
1
+ from unittest import TestCase
2
+
3
+ from piccolo.columns import Varchar
4
+ from piccolo.table import Table
5
+
6
+
7
+ class Manager(Table):
8
+ name = Varchar(unique=True)
9
+ email = Varchar(unique=True)
10
+
11
+
12
+ class Band(Table):
13
+ name = Varchar(unique=True)
14
+ manager_name = Varchar()
15
+
16
+
17
+ class Concert(Table):
18
+ title = Varchar()
19
+ band_name = Varchar()
20
+
21
+
22
+ class TestJoinOn(TestCase):
23
+
24
+ tables = [Manager, Band, Concert]
25
+
26
+ def setUp(self):
27
+ for table in self.tables:
28
+ table.create_table().run_sync()
29
+
30
+ Manager.insert(
31
+ Manager(name="Guido", email="guido@example.com"),
32
+ Manager(name="Maz", email="maz@example.com"),
33
+ Manager(name="Graydon", email="graydon@example.com"),
34
+ ).run_sync()
35
+
36
+ Band.insert(
37
+ Band(name="Pythonistas", manager_name="Guido"),
38
+ Band(name="Rustaceans", manager_name="Graydon"),
39
+ ).run_sync()
40
+
41
+ Concert.insert(
42
+ Concert(
43
+ title="Rockfest",
44
+ band_name="Pythonistas",
45
+ ),
46
+ ).run_sync()
47
+
48
+ def tearDown(self):
49
+ for table in self.tables:
50
+ table.alter().drop_table().run_sync()
51
+
52
+ def test_join_on(self):
53
+ """
54
+ Do a simple join between two tables.
55
+ """
56
+ query = Band.select(
57
+ Band.name,
58
+ Band.manager_name,
59
+ Band.manager_name.join_on(Manager.name).email.as_alias(
60
+ "manager_email"
61
+ ),
62
+ ).order_by(Band.id)
63
+
64
+ response = query.run_sync()
65
+
66
+ self.assertListEqual(
67
+ response,
68
+ [
69
+ {
70
+ "name": "Pythonistas",
71
+ "manager_name": "Guido",
72
+ "manager_email": "guido@example.com",
73
+ },
74
+ {
75
+ "name": "Rustaceans",
76
+ "manager_name": "Graydon",
77
+ "manager_email": "graydon@example.com",
78
+ },
79
+ ],
80
+ )
81
+
82
+ def test_deeper_join(self):
83
+ """
84
+ Do a join between three tables.
85
+ """
86
+ response = (
87
+ Concert.select(
88
+ Concert.title,
89
+ Concert.band_name,
90
+ Concert.band_name.join_on(Band.name)
91
+ .manager_name.join_on(Manager.name)
92
+ .email.as_alias("manager_email"),
93
+ )
94
+ .order_by(Concert.id)
95
+ .run_sync()
96
+ )
97
+
98
+ self.assertListEqual(
99
+ response,
100
+ [
101
+ {
102
+ "title": "Rockfest",
103
+ "band_name": "Pythonistas",
104
+ "manager_email": "guido@example.com",
105
+ }
106
+ ],
107
+ )