jmoiron / sqlx

general purpose extensions to golang's database/sql
http://jmoiron.github.io/sqlx/
MIT License
16.3k stars 1.09k forks source link

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

Open kelzenberg opened 3 months ago

kelzenberg commented 3 months ago

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
    }
}