-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Sqlite: Empty string init and coalescing for various properties #20172
Conversation
private ConnectionState _state; | ||
private sqlite3 _db; | ||
private bool _extensionsEnabled; | ||
|
||
private static readonly SqliteConnectionStringBuilder _emptyConnectionOptions = new SqliteConnectionStringBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems dangerous since SqliteConnectionStringBuilder
is mutable. I assume we never mutate it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I did a check and your codebase seems to be only reading from it (which seems like a good thing - mutable by the user, not by the driver). Are you good with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SqlClient splits it into a mutable and an immutable type (for perf mostly). But I was lazy.
I'm good with it
|
||
Assert.Equal(Resources.OpenRequiresSetConnectionString, ex.Message); | ||
using var connection = new SqliteConnection(); | ||
connection.Open(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dude, where's my data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a SELECT 1 after this, that's what you meant right? Just to note that there are various other Open tests which don't do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I just mean that most people will have no idea what this does and will be confused when their database is deleted when the connection is closed.
The test is fine
88b3f4e
to
2a3e1d5
Compare
Closes #20171