Skip to content

Commit

Permalink
fix: Query syntax (#952)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajc242 authored Sep 5, 2024
1 parent 5776b8d commit 87453fb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,8 @@
"with DB.connect() as conn:\n",
" print(\"connected to database\")\n",
" if not POSTGRESQL_TABLE_LIST and not POSTGRESQL_SCHEMA_LIST: # Migrate all possible tables from database\n",
" results = conn.execute(text("select TABLE_SCHEMA,TABLE_NAME from INFORMATION_SCHEMA.Tables where TABLE_SCHEMA not in ('pg_catalog','information_schema')")).fetchall()\n",
" query_str = \"select TABLE_SCHEMA,TABLE_NAME from INFORMATION_SCHEMA.Tables where TABLE_SCHEMA not in ('pg_catalog','information_schema');\"\n",
" results = conn.execute(text(query_str)).fetchall()\n",
"\n",
" elif POSTGRESQL_SCHEMA_LIST and not POSTGRESQL_TABLE_LIST: # Only Migrate tables associated with the provided schema list\n",
" results = conn.execute(text(\"select TABLE_SCHEMA,TABLE_NAME from INFORMATION_SCHEMA.Tables where TABLE_SCHEMA in ('{}');\".format(\"','\".join(POSTGRESQL_SCHEMA_LIST)))).fetchall()\n",
Expand Down

0 comments on commit 87453fb

Please sign in to comment.