Portable SQL toolkit for Go — write database code once, run it on MySQL / MariaDB, PostgreSQL / CockroachDB and SQLite.
import (
"github.com/portablesql/psql"
_ "github.com/portablesql/psql-sqlite" // or psql-mysql, psql-pgsql
)
be, err := psql.New(":memory:") // engine detected from the DSN
ctx := be.Plug(context.Background())Drivers register themselves on import, and only the driver you import gets downloaded.
- Website
- Getting Started and the other guides
- API reference
