-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
It doesn't look like changes in a table are consistently reflected in the SQLConnection objects since they are not mutable.
import SQLite
import FunSQL: DBInterface, SQLConnection, reflect
conn1 = DBInterface.connect(SQLConnection{SQLite.DB})
conn2 = DBInterface.connect(SQLConnection{SQLite.DB})
DBInterface.execute(conn2, "CREATE TABLE t (id int)")
@assert conn1.catalog == reflect(conn1) # passes
@assert conn2.catalog == reflect(conn2) # fails
SQLite.DBInterface.execute(conn2, "SELECT * FROM t") # executes
FunSQL.DBInterface.execute(conn2, From(:t)) # does not execute
While reflect captures updates, a lot of places in the code make direct references to the (immutable) catalog field of the SQLConnection object. This means FunSQL.DBInterface.execute is unable to execute queries that are valid.
I wonder if there is a way to capture updates to the catalog, either by making SQLConnection mutable, or by using reflect instead of directly accessing the catalog field.
Metadata
Metadata
Assignees
Labels
No labels