We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4079f4a commit 94c15f6Copy full SHA for 94c15f6
sqlite3.go
@@ -2290,9 +2290,12 @@ type SQLiteConnector struct {
2290
}
2291
2292
// Connect implements driver.Connector.
2293
+// If the provided context is already cancelled, returns its error immediately.
2294
func (c *SQLiteConnector) Connect(ctx context.Context) (driver.Conn, error) {
- // Context is ignored for now, as SQLiteDriver.Open does not use it.
2295
- return c.DriverInstance.Open(c.DSN)
+ if err := ctx.Err(); err != nil {
2296
+ return nil, err
2297
+ }
2298
+ return c.DriverInstance.Open(c.DSN)
2299
2300
2301
// Driver returns the underlying driver.
0 commit comments