-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
SQLiteRows.Columns() returns outdated state #1284
Comments
Each time you open a database connection with When you call When you call In order to resolve this, you have to call Unfortunately, the other contributing factor is the fact that this driver itself caches the column names for a given result set from the first call to In short, you'd need to first fix this driver to stop caching the column names. But even if you fixed that, you'd still need to call |
That's OK, we call With that said, I don't think the current driver columns caching behavior is correct (it differs from other drivers and the above works as expected with modernc.org/sqlite). |
I'm not personally opposed to you removing the caching from this driver. Just be advised that if your query returns no rows, there is no way to get the column names with that approach. |
@rittneje I'm not going to remove anything. I'm just reporting an issue. And again, we don't call directly |
This is a little difficult to explain so I apologize if it seems confusing.
The problem is that when there 2+ live connections and 1 of the connection changes the schema, calling
rows.Columns()
from any of the other connections return an outdated list of columns (aka. the state before the schema change).Below is a minimal reproducible:
The text was updated successfully, but these errors were encountered: