Documentation
¶
Overview ¶
Command sqldb demonstrates a per-tenant database/sql connection manager.
Each tenant maps to its own DSN, and the manager opens and caches one *sql.DB per tenant on first use. This example registers a tiny no-op driver so it runs without any external dependency. In a real program you would import a real driver, for example:
import _ "github.com/mattn/go-sqlite3" // or modernc.org/sqlite
and pass its driver name to NewManager.
Click to show internal directories.
Click to hide internal directories.