Documentation
¶
Overview ¶
Package driver abstracts the engine-specific bits of cosql: connection opening, schema introspection, and EXPLAIN prefix. Query/exec themselves go through database/sql directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver interface {
Open() (*sql.DB, error)
Kind() string // "postgres" or "mysql"
ListObjects(ctx context.Context, db *sql.DB) ([]SchemaRow, error)
DescribeTable(ctx context.Context, db *sql.DB, table string) (*TableInfo, error)
// ExplainSQL wraps a user query into an EXPLAIN that returns rows.
ExplainSQL(sql string, analyze bool) string
}
Driver is implemented per engine. Callers Open once, pass the *sql.DB to the other methods so connections can be reused.
Click to show internal directories.
Click to hide internal directories.