Versions in this module Expand all Collapse all v1 v1.0.1 Nov 9, 2023 v1.0.0 Nov 8, 2023 Changes in this version + var ErrInvalidResult = fmt.Errorf("invalid result") + var ErrTableNotFound = fmt.Errorf("table not found") + var ErrUnknownDialect = fmt.Errorf("unknown dialect") + func RegisterEngine(name string, engineFunc EngineFunc) + type Engine interface + Close func() error + Dialect func() string + Query func(ctx context.Context, query string, args ...any) (cols []string, results [][]string, err error) + TableInfo func(ctx context.Context, tables string) (string, error) + TableNames func(ctx context.Context) ([]string, error) + type EngineFunc func(string) (Engine, error) + type SQLDatabase struct + Engine Engine + SampleRowsNumber int + func NewSQLDatabase(engine Engine, ignoreTables map[string]struct{}) (*SQLDatabase, error) + func NewSQLDatabaseWithDSN(dialect, dsn string, ignoreTables map[string]struct{}) (*SQLDatabase, error) + func (sd *SQLDatabase) Close() error + func (sd *SQLDatabase) Dialect() string + func (sd *SQLDatabase) Query(ctx context.Context, query string) (string, error) + func (sd *SQLDatabase) TableInfo(ctx context.Context, tables []string) (string, error) + func (sd *SQLDatabase) TableNames() []string