sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

`sqlx.Connect` doesn't return error on fake SQLite data source

Open kelzenberg opened this issue 6 months ago • 0 comments

When connecting to a non-existent data source with the sqlite3 driver, it does not return an error but creates that database file. That behaviour is not documented. Is that intended?

func TestConnect(t *testing.T) {
	_, err := sqlx.Connect("sqlite3", "fake")
	if err == nil {
		t.Error("Expected error, got nil") // Test fails
	}
}

kelzenberg avatar Aug 09 '24 09:08 kelzenberg