Skip to content
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

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

Open
kelzenberg opened this issue Aug 9, 2024 · 0 comments
Open

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

kelzenberg opened this issue Aug 9, 2024 · 0 comments

Comments

@kelzenberg
Copy link

kelzenberg commented Aug 9, 2024

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
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant