piccolo 1.27.0__tar.gz → 1.28.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.
- {piccolo-1.27.0 → piccolo-1.28.0}/PKG-INFO +1 -1
- piccolo-1.28.0/piccolo/__init__.py +1 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/app/commands/new.py +3 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/new.py +1 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/fixtures/commands/dump.py +8 -8
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/fixtures/commands/load.py +5 -5
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/fixtures/commands/shared.py +9 -9
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/auto/diffable_table.py +12 -12
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/auto/migration_manager.py +59 -66
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/auto/operations.py +14 -14
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/auto/schema_differ.py +35 -34
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/auto/schema_snapshot.py +3 -4
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/auto/serialisation.py +27 -24
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/auto/serialisation_legacy.py +2 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/commands/backwards.py +1 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/commands/base.py +12 -12
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/commands/check.py +2 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/commands/clean.py +3 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/commands/forwards.py +1 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/commands/new.py +6 -6
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/tables.py +3 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/playground/commands/run.py +29 -13
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/schema/commands/generate.py +49 -49
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/schema/commands/graph.py +5 -5
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/shell/commands/run.py +1 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/sql_shell/commands/run.py +4 -4
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/tester/commands/run.py +3 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/user/commands/change_permissions.py +6 -6
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/user/commands/create.py +7 -7
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/user/commands/list.py +2 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/user/tables.py +8 -8
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/base.py +84 -52
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/choices.py +2 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/column_types.py +297 -175
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/combination.py +15 -12
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/defaults/base.py +4 -4
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/defaults/date.py +4 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/defaults/interval.py +4 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/defaults/time.py +4 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/defaults/timestamp.py +4 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/defaults/timestamptz.py +4 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/defaults/uuid.py +3 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/m2m.py +28 -35
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/readable.py +4 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/reference.py +9 -9
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/conf/apps.py +53 -54
- piccolo-1.28.0/piccolo/custom_types.py +43 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/engine/base.py +14 -14
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/engine/cockroach.py +5 -4
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/engine/finder.py +2 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/engine/postgres.py +20 -19
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/engine/sqlite.py +23 -22
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/base.py +30 -29
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/functions/__init__.py +12 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/functions/aggregate.py +4 -3
- piccolo-1.28.0/piccolo/query/functions/array.py +151 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/functions/base.py +3 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/functions/datetime.py +22 -22
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/functions/string.py +4 -4
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/functions/type_conversion.py +30 -15
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/alter.py +47 -46
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/count.py +11 -10
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/create.py +6 -5
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/create_index.py +9 -8
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/delete.py +7 -6
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/drop_index.py +7 -6
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/exists.py +6 -5
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/indexes.py +4 -4
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/insert.py +21 -14
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/objects.py +60 -50
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/raw.py +7 -6
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/refresh.py +8 -7
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/select.py +56 -49
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/table_exists.py +5 -5
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/update.py +8 -7
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/mixins.py +56 -61
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/operators/json.py +11 -11
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/proxy.py +8 -9
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/querystring.py +14 -15
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/schema.py +10 -10
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/table.py +93 -94
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/table_reflection.py +9 -9
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/testing/model_builder.py +12 -11
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/testing/random_builder.py +2 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/testing/test_case.py +4 -4
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/dictionary.py +3 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/encoding.py +5 -5
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/lazy_loader.py +3 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/list.py +7 -8
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/objects.py +4 -6
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/pydantic.py +21 -24
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/sql_values.py +3 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/sync.py +4 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/warnings.py +1 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo.egg-info/PKG-INFO +1 -1
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo.egg-info/SOURCES.txt +1 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/setup.py +2 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/fixtures/commands/test_dump_load.py +1 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/auto/integration/test_migrations.py +32 -7
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/auto/test_migration_manager.py +2 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/auto/test_schema_differ.py +22 -23
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/commands/test_forwards_backwards.py +3 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/m2m/base.py +2 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_array.py +176 -10
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_boolean.py +2 -4
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_combination.py +29 -1
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_db_column_name.py +2 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/engine/test_extra_nodes.py +2 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/engine/test_pool.py +3 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/engine/test_transaction.py +4 -4
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/test_freeze.py +4 -4
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/instance/test_get_related.py +2 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_alter.py +4 -4
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_indexes.py +1 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_refresh.py +2 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_select.py +58 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_update.py +3 -3
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/testing/test_model_builder.py +1 -2
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/utils/test_pydantic.py +36 -36
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/utils/test_table_reflection.py +1 -2
- piccolo-1.27.0/piccolo/__init__.py +0 -1
- piccolo-1.27.0/piccolo/custom_types.py +0 -21
- {piccolo-1.27.0 → piccolo-1.28.0}/LICENSE +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/README.md +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/app/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/app/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/app/commands/show_all.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/app/commands/templates/piccolo_app.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/app/commands/templates/tables.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/app/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/README.md.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/_esmerald_app.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/_falcon_app.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/_lilya_app.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/_litestar_app.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/_quart_app.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/_sanic_app.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/_starlette_app.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/app.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/conftest.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/__init__.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/_blacksheep_endpoints.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/_esmerald_endpoints.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/_falcon_endpoints.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/_lilya_endpoints.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/_litestar_endpoints.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/_quart_endpoints.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/_sanic_endpoints.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/_starlette_endpoints.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/piccolo_app.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/piccolo_migrations/README.md +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/tables.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/templates/base.html.jinja_raw +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/home/templates/home.html.jinja_raw +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/main.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/piccolo_conf.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/piccolo_conf_test.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/requirements.txt.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/static/favicon.ico +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/commands/templates/app/static/main.css +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/asgi/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/fixtures/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/fixtures/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/fixtures/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/meta/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/meta/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/meta/commands/version.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/meta/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/auto/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/commands/templates/migration.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/migrations/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/playground/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/playground/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/playground/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/project/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/project/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/project/commands/new.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/project/commands/templates/piccolo_conf.py.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/project/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/schema/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/schema/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/schema/commands/exceptions.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/schema/commands/templates/graphviz.dot.jinja +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/schema/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/shell/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/shell/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/shell/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/sql_shell/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/sql_shell/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/sql_shell/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/tester/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/tester/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/tester/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/user/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/user/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/user/commands/change_password.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/user/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/user/piccolo_migrations/2019-11-14T21-52-21.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/user/piccolo_migrations/2020-06-11T21-38-55.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/user/piccolo_migrations/2021-04-30T16-14-15.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/apps/user/piccolo_migrations/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/defaults/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/indexes.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/operators/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/operators/base.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/operators/comparison.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/operators/math.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/columns/operators/string.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/conf/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/engine/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/engine/exceptions.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/main.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/py.typed +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/constraints.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/functions/math.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/methods/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/query/operators/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/testing/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/graphlib/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/graphlib/_graphlib.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/naming.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/printing.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo/utils/repr.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo.egg-info/dependency_links.txt +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo.egg-info/entry_points.txt +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo.egg-info/requires.txt +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/piccolo.egg-info/top_level.txt +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/profiling/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/profiling/run_profile.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/pyproject.toml +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/setup.cfg +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/app/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/app/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/app/commands/test_new.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/app/commands/test_show_all.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/asgi/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/asgi/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/asgi/commands/test_new.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/fixtures/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/fixtures/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/fixtures/commands/test_shared.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/meta/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/meta/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/meta/commands/test_version.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/auto/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/auto/integration/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/auto/test_diffable_table.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/auto/test_schema_snapshot.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/auto/test_serialisation.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/commands/test_base.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/commands/test_check.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/commands/test_clean.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/commands/test_migrations/2020-03-31T20-38-22.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/commands/test_migrations/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/commands/test_new.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/migrations/test_migration.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/project/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/project/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/project/commands/test_new.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/schema/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/shell/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/shell/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/shell/commands/test_run.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/sql_shell/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/sql_shell/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/sql_shell/commands/test_run.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/tester/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/user/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/user/commands/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/user/commands/test_change_password.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/user/commands/test_change_permissions.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/user/commands/test_create.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/user/commands/test_list.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/apps/user/test_tables.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/m2m/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/m2m/test_m2m.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/m2m/test_m2m_schema.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_base.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_bigint.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_bytea.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_choices.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_date.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_defaults.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_double_precision.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_get_sql_value.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_integer.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_interval.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_json.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_jsonb.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_numeric.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_primary_key.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_readable.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_real.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_reference.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_reserved_column_names.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_smallint.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_time.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_timestamp.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_timestamptz.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_uuid.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/columns/test_varchar.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/conf/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/conf/example.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/conf/test_apps.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/engine/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/engine/test_logging.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/engine/test_nested_transaction.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/engine/test_version_parsing.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/example_apps/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/example_apps/mega/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/example_apps/mega/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/example_apps/mega/piccolo_migrations/2021-09-20T21-23-25-698988.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/example_apps/mega/piccolo_migrations/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/example_apps/mega/tables.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/example_apps/music/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/example_apps/music/piccolo_app.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/example_apps/music/tables.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/example_apps/music/tables_detailed.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/functions/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/functions/base.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/functions/test_datetime.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/functions/test_functions.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/functions/test_math.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/functions/test_string.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/functions/test_type_conversion.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/mixins/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/mixins/test_columns_delegate.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/mixins/test_order_by_delegate.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/operators/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/operators/test_json.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/test_await.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/test_camelcase.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/test_gather.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/test_querystring.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/query/test_slots.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/instance/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/instance/test_create.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/instance/test_get_related_readable.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/instance/test_instantiate.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/instance/test_remove.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/instance/test_save.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/instance/test_to_dict.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_all_columns.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_batch.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_callback.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_constructor.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_count.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_create.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_create_db_tables.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_create_table_class.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_delete.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_drop_db_tables.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_exists.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_from_dict.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_inheritance.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_insert.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_join.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_join_on.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_metaclass.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_objects.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_output.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_raw.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_ref.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_repr.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_str.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_table_exists.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/table/test_update_self.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/test_main.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/test_schema.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/testing/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/testing/test_random_builder.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/testing/test_test_case.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/utils/__init__.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/utils/test_dictionary.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/utils/test_encoding.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/utils/test_lazy_loader.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/utils/test_list.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/utils/test_naming.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/utils/test_printing.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/utils/test_sql_values.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/utils/test_sync.py +0 -0
- {piccolo-1.27.0 → piccolo-1.28.0}/tests/utils/test_warnings.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__VERSION__ = "1.28.0"
|
@@ -5,7 +5,7 @@ import os
|
|
5
5
|
import pathlib
|
6
6
|
import string
|
7
7
|
import sys
|
8
|
-
|
8
|
+
from typing import Any
|
9
9
|
|
10
10
|
import black
|
11
11
|
import jinja2
|
@@ -46,7 +46,7 @@ def validate_app_name(app_name: str):
|
|
46
46
|
|
47
47
|
"""
|
48
48
|
for char in app_name:
|
49
|
-
if
|
49
|
+
if char.lower() not in APP_NAME_ALLOWED_CHARACTERS:
|
50
50
|
raise ValueError(
|
51
51
|
f"The app name contains a disallowed character: `{char}`. "
|
52
52
|
"It must only include a-z, 0-9, and _ characters."
|
@@ -81,7 +81,7 @@ def new_app(app_name: str, root: str = ".", register: bool = False):
|
|
81
81
|
with open(os.path.join(app_root, "__init__.py"), "w"):
|
82
82
|
pass
|
83
83
|
|
84
|
-
templates:
|
84
|
+
templates: dict[str, Any] = {
|
85
85
|
"piccolo_app.py": {"app_name": app_name},
|
86
86
|
"tables.py": {},
|
87
87
|
}
|
@@ -2,7 +2,6 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
import os
|
4
4
|
import shutil
|
5
|
-
import typing as t
|
6
5
|
|
7
6
|
import black
|
8
7
|
import colorama
|
@@ -28,7 +27,7 @@ def print_instruction(message: str):
|
|
28
27
|
print(f"{colorama.Fore.CYAN}{message}{colorama.Fore.RESET}")
|
29
28
|
|
30
29
|
|
31
|
-
def get_options_string(options:
|
30
|
+
def get_options_string(options: list[str]):
|
32
31
|
return ", ".join(f"{name} [{index}]" for index, name in enumerate(options))
|
33
32
|
|
34
33
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
|
-
|
3
|
+
from typing import Any, Optional
|
4
4
|
|
5
5
|
from piccolo.apps.fixtures.commands.shared import (
|
6
6
|
FixtureConfig,
|
@@ -11,8 +11,8 @@ from piccolo.table import sort_table_classes
|
|
11
11
|
|
12
12
|
|
13
13
|
async def get_dump(
|
14
|
-
fixture_configs:
|
15
|
-
) ->
|
14
|
+
fixture_configs: list[FixtureConfig],
|
15
|
+
) -> dict[str, Any]:
|
16
16
|
"""
|
17
17
|
Gets the data for each table specified and returns a data structure like:
|
18
18
|
|
@@ -32,7 +32,7 @@ async def get_dump(
|
|
32
32
|
"""
|
33
33
|
finder = Finder()
|
34
34
|
|
35
|
-
output:
|
35
|
+
output: dict[str, Any] = {}
|
36
36
|
|
37
37
|
for fixture_config in fixture_configs:
|
38
38
|
app_config = finder.get_app_config(app_name=fixture_config.app_name)
|
@@ -53,7 +53,7 @@ async def get_dump(
|
|
53
53
|
|
54
54
|
|
55
55
|
async def dump_to_json_string(
|
56
|
-
fixture_configs:
|
56
|
+
fixture_configs: list[FixtureConfig],
|
57
57
|
) -> str:
|
58
58
|
"""
|
59
59
|
Dumps all of the data for the given tables into a JSON string.
|
@@ -65,7 +65,7 @@ async def dump_to_json_string(
|
|
65
65
|
return pydantic_model(**dump).model_dump_json(indent=4)
|
66
66
|
|
67
67
|
|
68
|
-
def parse_args(apps: str, tables: str) ->
|
68
|
+
def parse_args(apps: str, tables: str) -> list[FixtureConfig]:
|
69
69
|
"""
|
70
70
|
Works out which apps and tables the user is referring to.
|
71
71
|
"""
|
@@ -80,11 +80,11 @@ def parse_args(apps: str, tables: str) -> t.List[FixtureConfig]:
|
|
80
80
|
# Must be a single app name
|
81
81
|
app_names.append(apps)
|
82
82
|
|
83
|
-
table_class_names:
|
83
|
+
table_class_names: Optional[list[str]] = None
|
84
84
|
|
85
85
|
if tables != "all":
|
86
86
|
table_class_names = tables.split(",") if "," in tables else [tables]
|
87
|
-
output:
|
87
|
+
output: list[FixtureConfig] = []
|
88
88
|
|
89
89
|
for app_name in app_names:
|
90
90
|
app_config = finder.get_app_config(app_name=app_name)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
import sys
|
4
|
-
|
4
|
+
from typing import Optional
|
5
5
|
|
6
6
|
import typing_extensions
|
7
7
|
|
@@ -20,7 +20,7 @@ from piccolo.utils.list import batch
|
|
20
20
|
async def load_json_string(
|
21
21
|
json_string: str,
|
22
22
|
chunk_size: int = 1000,
|
23
|
-
on_conflict_action:
|
23
|
+
on_conflict_action: Optional[OnConflictAction] = None,
|
24
24
|
):
|
25
25
|
"""
|
26
26
|
Parses the JSON string, and inserts the parsed data into the database.
|
@@ -55,7 +55,7 @@ async def load_json_string(
|
|
55
55
|
raise Exception("Unable to find the engine.")
|
56
56
|
|
57
57
|
# This is what we want to the insert into the database:
|
58
|
-
data:
|
58
|
+
data: dict[type[Table], list[Table]] = {}
|
59
59
|
|
60
60
|
for app_name in app_names:
|
61
61
|
app_model = getattr(fixture_pydantic_model, app_name)
|
@@ -94,7 +94,7 @@ async def load_json_string(
|
|
94
94
|
async def load(
|
95
95
|
path: str = "fixture.json",
|
96
96
|
chunk_size: int = 1000,
|
97
|
-
on_conflict:
|
97
|
+
on_conflict: Optional[
|
98
98
|
typing_extensions.Literal["DO NOTHING", "DO UPDATE"]
|
99
99
|
] = None,
|
100
100
|
):
|
@@ -118,7 +118,7 @@ async def load(
|
|
118
118
|
with open(path, "r") as f:
|
119
119
|
contents = f.read()
|
120
120
|
|
121
|
-
on_conflict_action:
|
121
|
+
on_conflict_action: Optional[OnConflictAction] = None
|
122
122
|
|
123
123
|
if on_conflict:
|
124
124
|
try:
|
@@ -1,42 +1,42 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
|
-
import typing as t
|
4
3
|
from dataclasses import dataclass
|
4
|
+
from typing import TYPE_CHECKING, Any
|
5
5
|
|
6
6
|
import pydantic
|
7
7
|
|
8
8
|
from piccolo.conf.apps import Finder
|
9
9
|
from piccolo.utils.pydantic import create_pydantic_model
|
10
10
|
|
11
|
-
if
|
11
|
+
if TYPE_CHECKING: # pragma: no cover
|
12
12
|
from piccolo.table import Table
|
13
13
|
|
14
14
|
|
15
15
|
@dataclass
|
16
16
|
class FixtureConfig:
|
17
17
|
app_name: str
|
18
|
-
table_class_names:
|
18
|
+
table_class_names: list[str]
|
19
19
|
|
20
20
|
|
21
|
-
def create_pydantic_fixture_model(fixture_configs:
|
21
|
+
def create_pydantic_fixture_model(fixture_configs: list[FixtureConfig]):
|
22
22
|
"""
|
23
23
|
Returns a nested Pydantic model for serialising and deserialising fixtures.
|
24
24
|
"""
|
25
|
-
columns:
|
25
|
+
columns: dict[str, Any] = {}
|
26
26
|
|
27
27
|
finder = Finder()
|
28
28
|
|
29
29
|
for fixture_config in fixture_configs:
|
30
30
|
|
31
|
-
app_columns:
|
31
|
+
app_columns: dict[str, Any] = {}
|
32
32
|
|
33
33
|
for table_class_name in fixture_config.table_class_names:
|
34
|
-
table_class:
|
34
|
+
table_class: type[Table] = finder.get_table_with_name(
|
35
35
|
app_name=fixture_config.app_name,
|
36
36
|
table_class_name=table_class_name,
|
37
37
|
)
|
38
38
|
app_columns[table_class_name] = (
|
39
|
-
|
39
|
+
list[ # type: ignore
|
40
40
|
create_pydantic_model(
|
41
41
|
table_class, include_default_columns=True
|
42
42
|
)
|
@@ -44,7 +44,7 @@ def create_pydantic_fixture_model(fixture_configs: t.List[FixtureConfig]):
|
|
44
44
|
...,
|
45
45
|
)
|
46
46
|
|
47
|
-
app_model:
|
47
|
+
app_model: Any = pydantic.create_model(
|
48
48
|
f"{fixture_config.app_name.title()}Model", **app_columns
|
49
49
|
)
|
50
50
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
|
-
import typing as t
|
4
3
|
from dataclasses import dataclass, field
|
4
|
+
from typing import Any, Optional
|
5
5
|
|
6
6
|
from piccolo.apps.migrations.auto.operations import (
|
7
7
|
AddColumn,
|
@@ -17,8 +17,8 @@ from piccolo.table import Table, create_table_class
|
|
17
17
|
|
18
18
|
|
19
19
|
def compare_dicts(
|
20
|
-
dict_1:
|
21
|
-
) ->
|
20
|
+
dict_1: dict[str, Any], dict_2: dict[str, Any]
|
21
|
+
) -> dict[str, Any]:
|
22
22
|
"""
|
23
23
|
Returns a new dictionary which only contains key, value pairs which are in
|
24
24
|
the first dictionary and not the second.
|
@@ -59,9 +59,9 @@ def compare_dicts(
|
|
59
59
|
|
60
60
|
@dataclass
|
61
61
|
class TableDelta:
|
62
|
-
add_columns:
|
63
|
-
drop_columns:
|
64
|
-
alter_columns:
|
62
|
+
add_columns: list[AddColumn] = field(default_factory=list)
|
63
|
+
drop_columns: list[DropColumn] = field(default_factory=list)
|
64
|
+
alter_columns: list[AlterColumn] = field(default_factory=list)
|
65
65
|
|
66
66
|
def __eq__(self, value: TableDelta) -> bool: # type: ignore
|
67
67
|
"""
|
@@ -101,12 +101,12 @@ class DiffableTable:
|
|
101
101
|
|
102
102
|
class_name: str
|
103
103
|
tablename: str
|
104
|
-
schema:
|
105
|
-
columns:
|
106
|
-
previous_class_name:
|
104
|
+
schema: Optional[str] = None
|
105
|
+
columns: list[Column] = field(default_factory=list)
|
106
|
+
previous_class_name: Optional[str] = None
|
107
107
|
|
108
108
|
def __post_init__(self) -> None:
|
109
|
-
self.columns_map:
|
109
|
+
self.columns_map: dict[str, Column] = {
|
110
110
|
i._meta.name: i for i in self.columns
|
111
111
|
}
|
112
112
|
|
@@ -163,7 +163,7 @@ class DiffableTable:
|
|
163
163
|
|
164
164
|
#######################################################################
|
165
165
|
|
166
|
-
alter_columns:
|
166
|
+
alter_columns: list[AlterColumn] = []
|
167
167
|
|
168
168
|
for existing_column in value.columns:
|
169
169
|
column = self.columns_map.get(existing_column._meta.name)
|
@@ -221,7 +221,7 @@ class DiffableTable:
|
|
221
221
|
def __str__(self):
|
222
222
|
return f"{self.class_name} - {self.tablename}"
|
223
223
|
|
224
|
-
def to_table_class(self) ->
|
224
|
+
def to_table_class(self) -> type[Table]:
|
225
225
|
"""
|
226
226
|
Converts the DiffableTable into a Table subclass.
|
227
227
|
"""
|
@@ -2,8 +2,9 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
import inspect
|
4
4
|
import logging
|
5
|
-
import
|
5
|
+
from collections.abc import Callable, Coroutine
|
6
6
|
from dataclasses import dataclass, field
|
7
|
+
from typing import Any, Optional, Union
|
7
8
|
|
8
9
|
from piccolo.apps.migrations.auto.diffable_table import DiffableTable
|
9
10
|
from piccolo.apps.migrations.auto.operations import (
|
@@ -32,19 +33,19 @@ class AddColumnClass:
|
|
32
33
|
column: Column
|
33
34
|
table_class_name: str
|
34
35
|
tablename: str
|
35
|
-
schema:
|
36
|
+
schema: Optional[str]
|
36
37
|
|
37
38
|
|
38
39
|
@dataclass
|
39
40
|
class AddColumnCollection:
|
40
|
-
add_columns:
|
41
|
+
add_columns: list[AddColumnClass] = field(default_factory=list)
|
41
42
|
|
42
43
|
def append(self, add_column: AddColumnClass):
|
43
44
|
self.add_columns.append(add_column)
|
44
45
|
|
45
46
|
def for_table_class_name(
|
46
47
|
self, table_class_name: str
|
47
|
-
) ->
|
48
|
+
) -> list[AddColumnClass]:
|
48
49
|
return [
|
49
50
|
i
|
50
51
|
for i in self.add_columns
|
@@ -53,7 +54,7 @@ class AddColumnCollection:
|
|
53
54
|
|
54
55
|
def columns_for_table_class_name(
|
55
56
|
self, table_class_name: str
|
56
|
-
) ->
|
57
|
+
) -> list[Column]:
|
57
58
|
return [
|
58
59
|
i.column
|
59
60
|
for i in self.add_columns
|
@@ -61,20 +62,18 @@ class AddColumnCollection:
|
|
61
62
|
]
|
62
63
|
|
63
64
|
@property
|
64
|
-
def table_class_names(self) ->
|
65
|
+
def table_class_names(self) -> list[str]:
|
65
66
|
return list({i.table_class_name for i in self.add_columns})
|
66
67
|
|
67
68
|
|
68
69
|
@dataclass
|
69
70
|
class DropColumnCollection:
|
70
|
-
drop_columns:
|
71
|
+
drop_columns: list[DropColumn] = field(default_factory=list)
|
71
72
|
|
72
73
|
def append(self, drop_column: DropColumn):
|
73
74
|
self.drop_columns.append(drop_column)
|
74
75
|
|
75
|
-
def for_table_class_name(
|
76
|
-
self, table_class_name: str
|
77
|
-
) -> t.List[DropColumn]:
|
76
|
+
def for_table_class_name(self, table_class_name: str) -> list[DropColumn]:
|
78
77
|
return [
|
79
78
|
i
|
80
79
|
for i in self.drop_columns
|
@@ -82,20 +81,20 @@ class DropColumnCollection:
|
|
82
81
|
]
|
83
82
|
|
84
83
|
@property
|
85
|
-
def table_class_names(self) ->
|
84
|
+
def table_class_names(self) -> list[str]:
|
86
85
|
return list({i.table_class_name for i in self.drop_columns})
|
87
86
|
|
88
87
|
|
89
88
|
@dataclass
|
90
89
|
class RenameColumnCollection:
|
91
|
-
rename_columns:
|
90
|
+
rename_columns: list[RenameColumn] = field(default_factory=list)
|
92
91
|
|
93
92
|
def append(self, rename_column: RenameColumn):
|
94
93
|
self.rename_columns.append(rename_column)
|
95
94
|
|
96
95
|
def for_table_class_name(
|
97
96
|
self, table_class_name: str
|
98
|
-
) ->
|
97
|
+
) -> list[RenameColumn]:
|
99
98
|
return [
|
100
99
|
i
|
101
100
|
for i in self.rename_columns
|
@@ -103,20 +102,18 @@ class RenameColumnCollection:
|
|
103
102
|
]
|
104
103
|
|
105
104
|
@property
|
106
|
-
def table_class_names(self) ->
|
105
|
+
def table_class_names(self) -> list[str]:
|
107
106
|
return list({i.table_class_name for i in self.rename_columns})
|
108
107
|
|
109
108
|
|
110
109
|
@dataclass
|
111
110
|
class AlterColumnCollection:
|
112
|
-
alter_columns:
|
111
|
+
alter_columns: list[AlterColumn] = field(default_factory=list)
|
113
112
|
|
114
113
|
def append(self, alter_column: AlterColumn):
|
115
114
|
self.alter_columns.append(alter_column)
|
116
115
|
|
117
|
-
def for_table_class_name(
|
118
|
-
self, table_class_name: str
|
119
|
-
) -> t.List[AlterColumn]:
|
116
|
+
def for_table_class_name(self, table_class_name: str) -> list[AlterColumn]:
|
120
117
|
return [
|
121
118
|
i
|
122
119
|
for i in self.alter_columns
|
@@ -124,11 +121,11 @@ class AlterColumnCollection:
|
|
124
121
|
]
|
125
122
|
|
126
123
|
@property
|
127
|
-
def table_class_names(self) ->
|
124
|
+
def table_class_names(self) -> list[str]:
|
128
125
|
return list({i.table_class_name for i in self.alter_columns})
|
129
126
|
|
130
127
|
|
131
|
-
AsyncFunction =
|
128
|
+
AsyncFunction = Callable[[], Coroutine]
|
132
129
|
|
133
130
|
|
134
131
|
class SkippedTransaction:
|
@@ -158,12 +155,10 @@ class MigrationManager:
|
|
158
155
|
app_name: str = ""
|
159
156
|
description: str = ""
|
160
157
|
preview: bool = False
|
161
|
-
add_tables:
|
162
|
-
drop_tables:
|
163
|
-
rename_tables:
|
164
|
-
change_table_schemas:
|
165
|
-
default_factory=list
|
166
|
-
)
|
158
|
+
add_tables: list[DiffableTable] = field(default_factory=list)
|
159
|
+
drop_tables: list[DiffableTable] = field(default_factory=list)
|
160
|
+
rename_tables: list[RenameTable] = field(default_factory=list)
|
161
|
+
change_table_schemas: list[ChangeTableSchema] = field(default_factory=list)
|
167
162
|
add_columns: AddColumnCollection = field(
|
168
163
|
default_factory=AddColumnCollection
|
169
164
|
)
|
@@ -176,10 +171,8 @@ class MigrationManager:
|
|
176
171
|
alter_columns: AlterColumnCollection = field(
|
177
172
|
default_factory=AlterColumnCollection
|
178
173
|
)
|
179
|
-
raw:
|
180
|
-
|
181
|
-
)
|
182
|
-
raw_backwards: t.List[t.Union[t.Callable, AsyncFunction]] = field(
|
174
|
+
raw: list[Union[Callable, AsyncFunction]] = field(default_factory=list)
|
175
|
+
raw_backwards: list[Union[Callable, AsyncFunction]] = field(
|
183
176
|
default_factory=list
|
184
177
|
)
|
185
178
|
fake: bool = False
|
@@ -189,8 +182,8 @@ class MigrationManager:
|
|
189
182
|
self,
|
190
183
|
class_name: str,
|
191
184
|
tablename: str,
|
192
|
-
schema:
|
193
|
-
columns:
|
185
|
+
schema: Optional[str] = None,
|
186
|
+
columns: Optional[list[Column]] = None,
|
194
187
|
):
|
195
188
|
if not columns:
|
196
189
|
columns = []
|
@@ -205,7 +198,7 @@ class MigrationManager:
|
|
205
198
|
)
|
206
199
|
|
207
200
|
def drop_table(
|
208
|
-
self, class_name: str, tablename: str, schema:
|
201
|
+
self, class_name: str, tablename: str, schema: Optional[str] = None
|
209
202
|
):
|
210
203
|
self.drop_tables.append(
|
211
204
|
DiffableTable(
|
@@ -217,8 +210,8 @@ class MigrationManager:
|
|
217
210
|
self,
|
218
211
|
class_name: str,
|
219
212
|
tablename: str,
|
220
|
-
new_schema:
|
221
|
-
old_schema:
|
213
|
+
new_schema: Optional[str] = None,
|
214
|
+
old_schema: Optional[str] = None,
|
222
215
|
):
|
223
216
|
self.change_table_schemas.append(
|
224
217
|
ChangeTableSchema(
|
@@ -235,7 +228,7 @@ class MigrationManager:
|
|
235
228
|
old_tablename: str,
|
236
229
|
new_class_name: str,
|
237
230
|
new_tablename: str,
|
238
|
-
schema:
|
231
|
+
schema: Optional[str] = None,
|
239
232
|
):
|
240
233
|
self.rename_tables.append(
|
241
234
|
RenameTable(
|
@@ -252,11 +245,11 @@ class MigrationManager:
|
|
252
245
|
table_class_name: str,
|
253
246
|
tablename: str,
|
254
247
|
column_name: str,
|
255
|
-
db_column_name:
|
248
|
+
db_column_name: Optional[str] = None,
|
256
249
|
column_class_name: str = "",
|
257
|
-
column_class:
|
258
|
-
params:
|
259
|
-
schema:
|
250
|
+
column_class: Optional[type[Column]] = None,
|
251
|
+
params: Optional[dict[str, Any]] = None,
|
252
|
+
schema: Optional[str] = None,
|
260
253
|
):
|
261
254
|
"""
|
262
255
|
Add a new column to the table.
|
@@ -297,8 +290,8 @@ class MigrationManager:
|
|
297
290
|
table_class_name: str,
|
298
291
|
tablename: str,
|
299
292
|
column_name: str,
|
300
|
-
db_column_name:
|
301
|
-
schema:
|
293
|
+
db_column_name: Optional[str] = None,
|
294
|
+
schema: Optional[str] = None,
|
302
295
|
):
|
303
296
|
self.drop_columns.append(
|
304
297
|
DropColumn(
|
@@ -316,9 +309,9 @@ class MigrationManager:
|
|
316
309
|
tablename: str,
|
317
310
|
old_column_name: str,
|
318
311
|
new_column_name: str,
|
319
|
-
old_db_column_name:
|
320
|
-
new_db_column_name:
|
321
|
-
schema:
|
312
|
+
old_db_column_name: Optional[str] = None,
|
313
|
+
new_db_column_name: Optional[str] = None,
|
314
|
+
schema: Optional[str] = None,
|
322
315
|
):
|
323
316
|
self.rename_columns.append(
|
324
317
|
RenameColumn(
|
@@ -337,12 +330,12 @@ class MigrationManager:
|
|
337
330
|
table_class_name: str,
|
338
331
|
tablename: str,
|
339
332
|
column_name: str,
|
340
|
-
db_column_name:
|
341
|
-
params:
|
342
|
-
old_params:
|
343
|
-
column_class:
|
344
|
-
old_column_class:
|
345
|
-
schema:
|
333
|
+
db_column_name: Optional[str] = None,
|
334
|
+
params: Optional[dict[str, Any]] = None,
|
335
|
+
old_params: Optional[dict[str, Any]] = None,
|
336
|
+
column_class: Optional[type[Column]] = None,
|
337
|
+
old_column_class: Optional[type[Column]] = None,
|
338
|
+
schema: Optional[str] = None,
|
346
339
|
):
|
347
340
|
"""
|
348
341
|
All possible alterations aren't currently supported.
|
@@ -365,14 +358,14 @@ class MigrationManager:
|
|
365
358
|
)
|
366
359
|
)
|
367
360
|
|
368
|
-
def add_raw(self, raw:
|
361
|
+
def add_raw(self, raw: Union[Callable, AsyncFunction]):
|
369
362
|
"""
|
370
363
|
A migration manager can execute arbitrary functions or coroutines when
|
371
364
|
run. This is useful if you want to execute raw SQL.
|
372
365
|
"""
|
373
366
|
self.raw.append(raw)
|
374
367
|
|
375
|
-
def add_raw_backwards(self, raw:
|
368
|
+
def add_raw_backwards(self, raw: Union[Callable, AsyncFunction]):
|
376
369
|
"""
|
377
370
|
When reversing a migration, you may want to run extra code to help
|
378
371
|
clean up.
|
@@ -384,10 +377,10 @@ class MigrationManager:
|
|
384
377
|
async def get_table_from_snapshot(
|
385
378
|
self,
|
386
379
|
table_class_name: str,
|
387
|
-
app_name:
|
380
|
+
app_name: Optional[str],
|
388
381
|
offset: int = 0,
|
389
|
-
migration_id:
|
390
|
-
) ->
|
382
|
+
migration_id: Optional[str] = None,
|
383
|
+
) -> type[Table]:
|
391
384
|
"""
|
392
385
|
Returns a Table subclass which can be used for modifying data within
|
393
386
|
a migration.
|
@@ -416,13 +409,13 @@ class MigrationManager:
|
|
416
409
|
###########################################################################
|
417
410
|
|
418
411
|
@staticmethod
|
419
|
-
async def _print_query(query:
|
412
|
+
async def _print_query(query: Union[DDL, Query, SchemaDDLBase]):
|
420
413
|
if isinstance(query, DDL):
|
421
414
|
print("\n", ";".join(query.ddl) + ";")
|
422
415
|
else:
|
423
416
|
print(str(query))
|
424
417
|
|
425
|
-
async def _run_query(self, query:
|
418
|
+
async def _run_query(self, query: Union[DDL, Query, SchemaDDLBase]):
|
426
419
|
"""
|
427
420
|
If MigrationManager is in preview mode then it just print the query
|
428
421
|
instead of executing it.
|
@@ -441,7 +434,7 @@ class MigrationManager:
|
|
441
434
|
if not alter_columns:
|
442
435
|
continue
|
443
436
|
|
444
|
-
_Table:
|
437
|
+
_Table: type[Table] = create_table_class(
|
445
438
|
class_name=table_class_name,
|
446
439
|
class_kwargs={
|
447
440
|
"tablename": alter_columns[0].tablename,
|
@@ -494,7 +487,7 @@ class MigrationManager:
|
|
494
487
|
alter_column.db_column_name
|
495
488
|
)
|
496
489
|
|
497
|
-
using_expression:
|
490
|
+
using_expression: Optional[str] = None
|
498
491
|
|
499
492
|
# Postgres won't automatically cast some types to
|
500
493
|
# others. We may as well try, as it will definitely
|
@@ -739,7 +732,7 @@ class MigrationManager:
|
|
739
732
|
else rename_table.new_tablename
|
740
733
|
)
|
741
734
|
|
742
|
-
_Table:
|
735
|
+
_Table: type[Table] = create_table_class(
|
743
736
|
class_name=class_name,
|
744
737
|
class_kwargs={
|
745
738
|
"tablename": tablename,
|
@@ -760,7 +753,7 @@ class MigrationManager:
|
|
760
753
|
if not columns:
|
761
754
|
continue
|
762
755
|
|
763
|
-
_Table:
|
756
|
+
_Table: type[Table] = create_table_class(
|
764
757
|
class_name=table_class_name,
|
765
758
|
class_kwargs={
|
766
759
|
"tablename": columns[0].tablename,
|
@@ -788,12 +781,12 @@ class MigrationManager:
|
|
788
781
|
)
|
789
782
|
|
790
783
|
async def _run_add_tables(self, backwards: bool = False):
|
791
|
-
table_classes:
|
784
|
+
table_classes: list[type[Table]] = []
|
792
785
|
for add_table in self.add_tables:
|
793
|
-
add_columns:
|
786
|
+
add_columns: list[AddColumnClass] = (
|
794
787
|
self.add_columns.for_table_class_name(add_table.class_name)
|
795
788
|
)
|
796
|
-
_Table:
|
789
|
+
_Table: type[Table] = create_table_class(
|
797
790
|
class_name=add_table.class_name,
|
798
791
|
class_kwargs={
|
799
792
|
"tablename": add_table.tablename,
|
@@ -845,7 +838,7 @@ class MigrationManager:
|
|
845
838
|
if table_class_name in [i.class_name for i in self.add_tables]:
|
846
839
|
continue # No need to add columns to new tables
|
847
840
|
|
848
|
-
add_columns:
|
841
|
+
add_columns: list[AddColumnClass] = (
|
849
842
|
self.add_columns.for_table_class_name(table_class_name)
|
850
843
|
)
|
851
844
|
|