Documentation
¶
Overview ¶
Package sqlite holds the dialect-generic SQL query provider and registers it under the "sqlite" key. A host that only needs SQLite-backed record stores enables it without the cloud providers:
import _ "github.com/flanksource/commons-db/query/providers/sqlite"
query/providers registers the remaining SQL keys (sql, postgres, mysql, sqlserver, clickhouse) through NewSQLProvider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSQLProvider ¶
NewSQLProvider returns the SQL provider registered under key. connType presets the connection driver type; empty takes it from the request's options or connection.
Types ¶
type SQLPageRequest ¶
type SQLPageRequest struct {
// Connection names the connection client is, for the SQL statement tap.
Connection string
Query string
QueryArgs []any
QueryIdentifiers []string
Filters []query.ColumnFilterValue
Order query.Order
Position query.CursorPosition
Page query.PageRequest
Diagnostics *query.ProviderDiagnostics
}
type SQLPageResult ¶
type SQLPageResult struct {
Rows []query.Row
ColumnTypes []*sql.ColumnType
Total *query.Total
HasMore bool
}
func ReadSQLPage ¶
func ReadSQLPage(ctx context.Context, client *sql.DB, driver string, request SQLPageRequest) (result SQLPageResult, err error)
Click to show internal directories.
Click to hide internal directories.