Documentation
¶
Index ¶
- Constants
- func SheetColumnToIndex(col string) int
- type AggregateFunction
- type AggregateFunctionColumn
- type BackingStore
- type ColumnMapping
- type IntermediateTable
- type IntermediateVisitor
- type JoinVisitor
- type QualifiedTableVisitor
- type QueryExecutor
- type RESTBacking
- func (r *RESTBacking) FillIntermediate(intermediate *IntermediateTable)
- func (r *RESTBacking) Get(s any, options RESTOptions, handler func(*http.Response) (any, error)) error
- func (r *RESTBacking) Rows() ResultRows
- func (r *RESTBacking) Visit(n sql.Node) (sql.Visitor, sql.Node, error)
- func (r *RESTBacking) VisitEnd(n sql.Node) (sql.Node, error)
- type RESTOptions
- type ResultRow
- type ResultRows
- type ResultValue
- type SQLiteBacking
- type SQLizer
- func (s *SQLizer) DDL() string
- func (s *SQLizer) Execute(statement string) (ResultRows, error)
- func (s *SQLizer) Matches(filter sql.Node, data any) bool
- func (s *SQLizer) SetBacking(backing BackingStore)
- func (s *SQLizer) SetPermissions(permissions uint)
- func (s *SQLizer) TableForData(data any) *Table
- func (s *SQLizer) TypeForData(data any) reflect.Type
- type SheetsBacking
- func (s *SheetsBacking) ComputeRangeString(colStart string, rowStart int, colEnd string, endRow int) string
- func (s *SheetsBacking) FillIntermediate(intermediate *IntermediateTable)
- func (s *SheetsBacking) Rows() ResultRows
- func (s *SheetsBacking) Visit(n sql.Node) (sql.Visitor, sql.Node, error)
- func (s *SheetsBacking) VisitEnd(n sql.Node) (sql.Node, error)
- type SheetsOptions
- type SliceFilter
- type Table
- type Validator
Constants ¶
View Source
const ( AllowSelectStatements = 1 << iota AllowInsertStatements AllowUpdateStatements AllowDeleteStatements )
Variables ¶
This section is empty.
Functions ¶
func SheetColumnToIndex ¶
SheetColumnToIndex converts a Google Sheets column name into its index ('A' -> 0, 'AA' -> 26)
Types ¶
type AggregateFunction ¶
type AggregateFunction func(*AggregateFunctionColumn, ResultRows) ResultRows
type AggregateFunctionColumn ¶
type AggregateFunctionColumn struct {
UnderlyingColumn string
ResultPosition int
Function AggregateFunction
}
func (*AggregateFunctionColumn) Call ¶
func (a *AggregateFunctionColumn) Call(rows ResultRows) ResultRows
type BackingStore ¶
type BackingStore interface {
sql.Visitor
Rows() ResultRows
}
type ColumnMapping ¶
type IntermediateTable ¶
type IntermediateTable struct {
Source *Table
Aliases map[string]string
Columns []string
Rows ResultRows
}
func NewIntermediateTable ¶
func NewIntermediateTable() *IntermediateTable
func (*IntermediateTable) Filter ¶
func (i *IntermediateTable) Filter(n sql.Node) *IntermediateTable
type IntermediateVisitor ¶
type IntermediateVisitor interface {
sql.Visitor
Result() *IntermediateTable
}
type JoinVisitor ¶
type JoinVisitor struct {
F *QueryExecutor
JoinResult *IntermediateTable
Sources []*IntermediateTable
Previous IntermediateVisitor
}
func (*JoinVisitor) Result ¶
func (j *JoinVisitor) Result() *IntermediateTable
type QualifiedTableVisitor ¶
type QualifiedTableVisitor struct {
F *QueryExecutor
Table *IntermediateTable
}
func (*QualifiedTableVisitor) Result ¶
func (i *QualifiedTableVisitor) Result() *IntermediateTable
type QueryExecutor ¶
type QueryExecutor struct {
FillIntermediate func(table *IntermediateTable)
// contains filtered or unexported fields
}
func NewQueryExecutor ¶
func NewQueryExecutor(s *SQLizer, f func(table *IntermediateTable)) *QueryExecutor
func (*QueryExecutor) Filter ¶
func (q *QueryExecutor) Filter() sql.Node
func (*QueryExecutor) Rows ¶
func (q *QueryExecutor) Rows() ResultRows
type RESTBacking ¶
type RESTBacking struct {
// contains filtered or unexported fields
}
func NewRESTBacking ¶
func NewRESTBacking(s *SQLizer) *RESTBacking
func (*RESTBacking) FillIntermediate ¶
func (r *RESTBacking) FillIntermediate(intermediate *IntermediateTable)
func (*RESTBacking) Get ¶
func (r *RESTBacking) Get(s any, options RESTOptions, handler func(*http.Response) (any, error)) error
func (*RESTBacking) Rows ¶
func (r *RESTBacking) Rows() ResultRows
type RESTOptions ¶
type ResultRow ¶
type ResultRow []ResultValue
type ResultRows ¶
type ResultRows []ResultRow
func (*ResultRows) String ¶
func (r *ResultRows) String() string
type ResultValue ¶
type SQLiteBacking ¶
type SQLiteBacking struct {
// contains filtered or unexported fields
}
func NewSQLiteBacking ¶
func NewSQLiteBacking(db *gosql.DB, s *SQLizer) *SQLiteBacking
New creates a new SQLiteBacking with the given SQLite database connection
func (*SQLiteBacking) Error ¶
func (s *SQLiteBacking) Error() error
Error returns the last error encountered during query execution
func (*SQLiteBacking) Rows ¶
func (s *SQLiteBacking) Rows() ResultRows
Rows implements duckql.BackingStore
type SQLizer ¶
type SQLizer struct {
Tables map[string]*Table
Permissions uint
Backing BackingStore
}
func Initialize ¶
func (*SQLizer) SetBacking ¶
func (s *SQLizer) SetBacking(backing BackingStore)
func (*SQLizer) SetPermissions ¶
func (*SQLizer) TableForData ¶
type SheetsBacking ¶
type SheetsBacking struct {
// contains filtered or unexported fields
}
func NewSheetsBacking ¶
func NewSheetsBacking(s *SQLizer, options *SheetsOptions) *SheetsBacking
func (*SheetsBacking) ComputeRangeString ¶
func (*SheetsBacking) FillIntermediate ¶
func (s *SheetsBacking) FillIntermediate(intermediate *IntermediateTable)
func (*SheetsBacking) Rows ¶
func (s *SheetsBacking) Rows() ResultRows
type SheetsOptions ¶
type SliceFilter ¶
type SliceFilter struct {
// contains filtered or unexported fields
}
func NewSliceFilter ¶
func NewSliceFilter(s *SQLizer, data []any) *SliceFilter
func (*SliceFilter) FillIntermediate ¶
func (f *SliceFilter) FillIntermediate(table *IntermediateTable)
func (*SliceFilter) Rows ¶
func (f *SliceFilter) Rows() ResultRows
Source Files
¶
Click to show internal directories.
Click to hide internal directories.