Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #12, #154 : disabling native json support #155

Merged
merged 1 commit into from
Sep 15, 2024
Merged

Conversation

@shimizukawa shimizukawa self-assigned this Sep 15, 2024
@shimizukawa
Copy link
Member Author

It worked!

version

(venv) @shimizukawa ➜ /workspaces/django-redshift-backend/examples/dj-sql-explorer (154-jsonb) $ uv pip list | grep django
django                      5.0.9
django-appconf              1.0.6
django-cryptography-django5 2.2
django-environ              0.8.1
django-redshift-backend     4.1.2.dev3  /workspaces/django-redshift-backend
django-sql-explorer         5.2

showmigrations

(venv) @shimizukawa ➜ /workspaces/django-redshift-backend/examples/dj-sql-explorer (154-jsonb) $ python manage.py showmigrations
admin
 [X] 0001_initial
 [X] 0002_logentry_remove_auto_add
 [X] 0003_logentry_add_action_flag_choices
auth
 [X] 0001_initial
 [X] 0002_alter_permission_name_max_length
 [X] 0003_alter_user_email_max_length
 [X] 0004_alter_user_username_opts
 [X] 0005_alter_user_last_login_null
 [X] 0006_require_contenttypes_0002
 [X] 0007_alter_validators_add_error_messages
 [X] 0008_alter_user_username_max_length
 [X] 0009_alter_user_last_name_max_length
 [X] 0010_alter_group_name_max_length
 [X] 0011_update_proxy_permissions
 [X] 0012_alter_user_first_name_max_length
contenttypes
 [X] 0001_initial
 [X] 0002_remove_content_type_name
explorer
 [X] 0001_initial
 [X] 0002_auto_20150501_1515
 [X] 0003_query_snapshot
 [X] 0004_querylog_duration
 [X] 0005_auto_20160105_2052
 [X] 0006_query_connection
 [X] 0007_querylog_connection
 [X] 0008_auto_20190308_1642
 [X] 0009_auto_20201009_0547
 [X] 0010_sql_required
 [X] 0011_query_favorites
 [X] 0012_alter_queryfavorite_query_alter_queryfavorite_user
 [X] 0013_querylog_error_querylog_success
 [X] 0014_promptlog
 [X] 0015_explorervalue
 [X] 0016_alter_explorervalue_key
 [X] 0017_databaseconnection
 [X] 0018_alter_databaseconnection_host_and_more
 [X] 0019_alter_databaseconnection_engine
 [ ] 0020_databaseconnection_extras_and_more
 [ ] 0021_alter_databaseconnection_password_and_more
 [ ] 0022_databaseconnection_upload_fingerprint
sessions
 [X] 0001_initial
testapp
 [X] 0001_initial

migrate

(venv) @shimizukawa ➜ /workspaces/django-redshift-backend/examples/dj-sql-explorer (154-jsonb) $ python manage.py migrate
(0.202) 
            SELECT c.relname,
            CASE WHEN c.relkind IN ('m', 'v') THEN 'v' ELSE 't' END
            FROM pg_catalog.pg_class c
            LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
            WHERE c.relkind IN ('f', 'm', 'p', 'r', 'v')
                AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
                AND pg_catalog.pg_table_is_visible(c.oid)
        ; args=None; alias=default
(0.163) SELECT "django_migrations"."id", "django_migrations"."app", "django_migrations"."name", "django_migrations"."applied" FROM "django_migrations"; args=(); alias=default
(0.168) 
            SELECT c.relname,
            CASE WHEN c.relkind IN ('m', 'v') THEN 'v' ELSE 't' END
            FROM pg_catalog.pg_class c
            LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
            WHERE c.relkind IN ('f', 'm', 'p', 'r', 'v')
                AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
                AND pg_catalog.pg_table_is_visible(c.oid)
        ; args=None; alias=default
(0.161) SELECT "django_migrations"."id", "django_migrations"."app", "django_migrations"."name", "django_migrations"."applied" FROM "django_migrations"; args=(); alias=default
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, explorer, sessions, testapp
Running migrations:
(0.167) 
            SELECT c.relname,
            CASE WHEN c.relkind IN ('m', 'v') THEN 'v' ELSE 't' END
            FROM pg_catalog.pg_class c
            LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
            WHERE c.relkind IN ('f', 'm', 'p', 'r', 'v')
                AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
                AND pg_catalog.pg_table_is_visible(c.oid)
        ; args=None; alias=default
  Applying explorer.0020_databaseconnection_extras_and_more...ALTER TABLE "explorer_databaseconnection" ADD COLUMN "extras" varchar NULL; (params [])
(0.197) ALTER TABLE "explorer_databaseconnection" ADD COLUMN "extras" varchar NULL; args=[]; alias=default
(0.263) INSERT INTO "django_migrations" ("app", "name", "applied") VALUES ('explorer', '0020_databaseconnection_extras_and_more', '2024-09-15T02:50:01.204609+00:00'::timestamptz); args=['explorer', '0020_databaseconnection_extras_and_more', datetime.datetime(2024, 9, 15, 2, 50, 1, 204609, tzinfo=datetime.timezone.utc)]; alias=default
(0.328) SELECT MAX(id) from "django_migrations"; args=None; alias=default
 OK
  Applying explorer.0021_alter_databaseconnection_password_and_more...ALTER TABLE "explorer_databaseconnection" ADD COLUMN "password_tmp" varbyte(255) NULL; (params [])
(0.195) ALTER TABLE "explorer_databaseconnection" ADD COLUMN "password_tmp" varbyte(255) NULL; args=[]; alias=default
UPDATE explorer_databaseconnection SET "password_tmp" = "password"::varbyte WHERE "password" IS NOT NULL; (params [])
(5.140) UPDATE explorer_databaseconnection SET "password_tmp" = "password"::varbyte WHERE "password" IS NOT NULL; args=[]; alias=default
ALTER TABLE explorer_databaseconnection DROP COLUMN "password" CASCADE; (params [])
(0.193) ALTER TABLE explorer_databaseconnection DROP COLUMN "password" CASCADE; args=[]; alias=default
ALTER TABLE explorer_databaseconnection RENAME COLUMN "password_tmp" TO "password"; (params [])
(0.187) ALTER TABLE explorer_databaseconnection RENAME COLUMN "password_tmp" TO "password"; args=[]; alias=default
ALTER TABLE "explorer_databaseconnection" ADD COLUMN "user_tmp" varbyte(255) NULL; (params [])
(0.194) ALTER TABLE "explorer_databaseconnection" ADD COLUMN "user_tmp" varbyte(255) NULL; args=[]; alias=default
UPDATE explorer_databaseconnection SET "user_tmp" = "user"::varbyte WHERE "user" IS NOT NULL; (params [])
(5.336) UPDATE explorer_databaseconnection SET "user_tmp" = "user"::varbyte WHERE "user" IS NOT NULL; args=[]; alias=default
ALTER TABLE explorer_databaseconnection DROP COLUMN "user" CASCADE; (params [])
(0.193) ALTER TABLE explorer_databaseconnection DROP COLUMN "user" CASCADE; args=[]; alias=default
ALTER TABLE explorer_databaseconnection RENAME COLUMN "user_tmp" TO "user"; (params [])
(0.198) ALTER TABLE explorer_databaseconnection RENAME COLUMN "user_tmp" TO "user"; args=[]; alias=default
(0.311) INSERT INTO "django_migrations" ("app", "name", "applied") VALUES ('explorer', '0021_alter_databaseconnection_password_and_more', '2024-09-15T02:50:13.439400+00:00'::timestamptz); args=['explorer', '0021_alter_databaseconnection_password_and_more', datetime.datetime(2024, 9, 15, 2, 50, 13, 439400, tzinfo=datetime.timezone.utc)]; alias=default
(0.176) SELECT MAX(id) from "django_migrations"; args=None; alias=default
 OK
  Applying explorer.0022_databaseconnection_upload_fingerprint...ALTER TABLE "explorer_databaseconnection" ADD COLUMN "upload_fingerprint" varchar(255) NULL; (params [])
(0.197) ALTER TABLE "explorer_databaseconnection" ADD COLUMN "upload_fingerprint" varchar(255) NULL; args=[]; alias=default
(0.254) INSERT INTO "django_migrations" ("app", "name", "applied") VALUES ('explorer', '0022_databaseconnection_upload_fingerprint', '2024-09-15T02:50:14.126628+00:00'::timestamptz); args=['explorer', '0022_databaseconnection_upload_fingerprint', datetime.datetime(2024, 9, 15, 2, 50, 14, 126628, tzinfo=datetime.timezone.utc)]; alias=default
(0.175) SELECT MAX(id) from "django_migrations"; args=None; alias=default
 OK
(0.284) SELECT "django_migrations"."id", "django_migrations"."app", "django_migrations"."name", "django_migrations"."applied" FROM "django_migrations"; args=(); alias=default
(0.162) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."app_label" = 'admin'; args=('admin',); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'admin' AND "django_content_type"."model" = 'logentry') LIMIT 21; args=('admin', 'logentry'); alias=default
(0.162) SELECT "auth_permission"."content_type_id", "auth_permission"."codename" FROM "auth_permission" INNER JOIN "django_content_type" ON ("auth_permission"."content_type_id" = "django_content_type"."id") WHERE "auth_permission"."content_type_id" IN (1) ORDER BY "django_content_type"."app_label" ASC, "django_content_type"."model" ASC, "auth_permission"."codename" ASC; args=(1,); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."app_label" = 'admin'; args=('admin',); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."app_label" = 'auth'; args=('auth',); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'auth' AND "django_content_type"."model" = 'permission') LIMIT 21; args=('auth', 'permission'); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'auth' AND "django_content_type"."model" = 'group') LIMIT 21; args=('auth', 'group'); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'auth' AND "django_content_type"."model" = 'user') LIMIT 21; args=('auth', 'user'); alias=default
(0.162) SELECT "auth_permission"."content_type_id", "auth_permission"."codename" FROM "auth_permission" INNER JOIN "django_content_type" ON ("auth_permission"."content_type_id" = "django_content_type"."id") WHERE "auth_permission"."content_type_id" IN (2, 3, 4) ORDER BY "django_content_type"."app_label" ASC, "django_content_type"."model" ASC, "auth_permission"."codename" ASC; args=(2, 3, 4); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."app_label" = 'auth'; args=('auth',); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."app_label" = 'contenttypes'; args=('contenttypes',); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'contenttypes' AND "django_content_type"."model" = 'contenttype') LIMIT 21; args=('contenttypes', 'contenttype'); alias=default
(0.161) SELECT "auth_permission"."content_type_id", "auth_permission"."codename" FROM "auth_permission" INNER JOIN "django_content_type" ON ("auth_permission"."content_type_id" = "django_content_type"."id") WHERE "auth_permission"."content_type_id" IN (5) ORDER BY "django_content_type"."app_label" ASC, "django_content_type"."model" ASC, "auth_permission"."codename" ASC; args=(5,); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."app_label" = 'contenttypes'; args=('contenttypes',); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."app_label" = 'sessions'; args=('sessions',); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'sessions' AND "django_content_type"."model" = 'session') LIMIT 21; args=('sessions', 'session'); alias=default
(0.161) SELECT "auth_permission"."content_type_id", "auth_permission"."codename" FROM "auth_permission" INNER JOIN "django_content_type" ON ("auth_permission"."content_type_id" = "django_content_type"."id") WHERE "auth_permission"."content_type_id" IN (6) ORDER BY "django_content_type"."app_label" ASC, "django_content_type"."model" ASC, "auth_permission"."codename" ASC; args=(6,); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."app_label" = 'sessions'; args=('sessions',); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."app_label" = 'explorer'; args=('explorer',); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'explorer' AND "django_content_type"."model" = 'query') LIMIT 21; args=('explorer', 'query'); alias=default
(0.216) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'explorer' AND "django_content_type"."model" = 'querylog') LIMIT 21; args=('explorer', 'querylog'); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'explorer' AND "django_content_type"."model" = 'queryfavorite') LIMIT 21; args=('explorer', 'queryfavorite'); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'explorer' AND "django_content_type"."model" = 'promptlog') LIMIT 21; args=('explorer', 'promptlog'); alias=default
(0.162) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'explorer' AND "django_content_type"."model" = 'explorervalue') LIMIT 21; args=('explorer', 'explorervalue'); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'explorer' AND "django_content_type"."model" = 'databaseconnection') LIMIT 21; args=('explorer', 'databaseconnection'); alias=default
(0.161) SELECT "auth_permission"."content_type_id", "auth_permission"."codename" FROM "auth_permission" INNER JOIN "django_content_type" ON ("auth_permission"."content_type_id" = "django_content_type"."id") WHERE "auth_permission"."content_type_id" IN (7, 8, 9, 10, 11, 12) ORDER BY "django_content_type"."app_label" ASC, "django_content_type"."model" ASC, "auth_permission"."codename" ASC; args=(7, 8, 9, 10, 11, 12); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."app_label" = 'explorer'; args=('explorer',); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."app_label" = 'testapp'; args=('testapp',); alias=default
(0.162) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'testapp' AND "django_content_type"."model" = 'testmodel') LIMIT 21; args=('testapp', 'testmodel'); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'testapp' AND "django_content_type"."model" = 'testparentmodel') LIMIT 21; args=('testapp', 'testparentmodel'); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'testapp' AND "django_content_type"."model" = 'testreferencedmodel') LIMIT 21; args=('testapp', 'testreferencedmodel'); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'testapp' AND "django_content_type"."model" = 'testchildmodel') LIMIT 21; args=('testapp', 'testchildmodel'); alias=default
(0.161) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'testapp' AND "django_content_type"."model" = 'testmodelwithmetakeys') LIMIT 21; args=('testapp', 'testmodelwithmetakeys'); alias=default
(0.161) SELECT "auth_permission"."content_type_id", "auth_permission"."codename" FROM "auth_permission" INNER JOIN "django_content_type" ON ("auth_permission"."content_type_id" = "django_content_type"."id") WHERE "auth_permission"."content_type_id" IN (13, 14, 15, 16, 17) ORDER BY "django_content_type"."app_label" ASC, "django_content_type"."model" ASC, "auth_permission"."codename" ASC; args=(13, 14, 15, 16, 17); alias=default
(0.162) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."app_label" = 'testapp'; args=('testapp',); alias=default

@shimizukawa shimizukawa marked this pull request as ready for review September 15, 2024 02:53
@shimizukawa shimizukawa merged commit e10cefe into master Sep 15, 2024
46 of 47 checks passed
@shimizukawa shimizukawa deleted the 154-jsonb branch September 15, 2024 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant