Skip to content

Commit ea14ad9

Browse files
committed
docs(database): document Provider.Connect non-nil success postcondition
1 parent 27eb0fb commit ea14ad9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

internal/database/provider.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import (
1212

1313
// Provider defines the contract for database-specific connection logic.
1414
type Provider interface {
15-
// Connect establishes a database connection and returns the *sql.DB and any error.
15+
// Connect establishes a database connection and returns the *sql.DB and any
16+
// error. On success (nil error) the returned *sql.DB MUST be non-nil — Open
17+
// applies the connection pool to it without a nil check.
1618
Connect(config *config.DataSourceConfig) (*sql.DB, error)
1719
// Kind returns the database kind this provider handles (postgres, mysql, or sqlite).
1820
Kind() config.DBKind

0 commit comments

Comments
 (0)