-
Notifications
You must be signed in to change notification settings - Fork 323
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
Temporary Tables are not listed in connection.tables
in Postgres
#6398
Comments
@jdunkerley do we want this? I guess it could be beneficial. I guess since we'd need to add them on-top of the results from the DB, all fields apart from |
Removed |
Yep, I'm already working on this. |
Radosław Waśko reports a new STANDUP for yesterday (2023-04-26): Progress: Implemented workaround ensuring that temporary tables are also included in tables listing. It should be finished by 2023-04-28. Next Day: Next day I will be working on the #6327 task. Start work on create_database_table for Database table (DB Query -> Table transfer) |
Radosław Waśko reports a new STANDUP for yesterday (2023-04-27): Progress: Wrote tests for the DB->DB create table. Applying code review suggestions. Figured out the temporary table workaround was not really needed - changed defaults on Next Day: Next day I will be working on the #6327 task. Implement |
When a temporary table is created on a connection, it is not seen in
connection.tables
:The table not showing up in
tables
is not a biggest issue (but probably ideally it should be there). The biggest issue is shown below - if we do aquery
- it is not recognized, because thequery
mechanism is using.tables
to recognize if a given string is a table name or SQL query - and since it is not present there, it is wrongly treated as an SQL query text and fails.Additionally, the method
create_database_table
will not be able to detect that the table with such a name already exists and report a tailored Enso error, falling back to genericSQL_Error
instead.So to improve the UX and avoid confusion, we should ensure that temporary tables are somehow accounted for. We should introduce some kind of State to the Postgres connection and append any temporary created tables to a list. Then we can have a
known_tables
helper which will list table names from both.tables
and that State.State
toPostgres_Connection
, holding a list of known temporary tables.query
to rely on this state.query
works correctly with existing tables.Table_Already_Exists
is correctly reported if the clashing table is temporary..tables
The text was updated successfully, but these errors were encountered: