Documentation
¶
Index ¶
- func ClearTxContext(ctx context.Context) context.Context
- func ColumnValue(a arrow.Array, i int) any
- func ParseSQLScriptTemplate(dbType ScriptDBType, script string) (string, error)
- func RecordToJSON(rec arrow.Record, asArray bool, w io.Writer) error
- func RecordsColNums(rr []arrow.Record) int64
- func RecordsRowNums(rr []arrow.Record) int64
- func RegisterScalarFunction(ctx context.Context, db *Pool, function ScalarFunction) error
- func RegisterScalarFunctionSet(ctx context.Context, db *Pool, set ScalarFunctionSet) error
- func RegisterTableRowFunction(ctx context.Context, db *Pool, function TableRowFunction) error
- func ReleaseRecords(rr []arrow.Record)
- func RetainRecords(rr []arrow.Record)
- type Arrow
- type ArrowTable
- type ArrowTableChunked
- func (t *ArrowTableChunked) Append(rec arrow.Record)
- func (t *ArrowTableChunked) Chunk(i int) arrow.Record
- func (t *ArrowTableChunked) DecodeMsgpack(dec *msgpack.Decoder) error
- func (t *ArrowTableChunked) EncodeMsgpack(enc *msgpack.Encoder) error
- func (t *ArrowTableChunked) Info() string
- func (t *ArrowTableChunked) MarshalJSON() ([]byte, error)
- func (t *ArrowTableChunked) NumChunks() int
- func (t *ArrowTableChunked) NumCols() int
- func (t *ArrowTableChunked) NumRows() int
- func (t *ArrowTableChunked) Reader(retain bool) (array.RecordReader, error)
- func (t *ArrowTableChunked) Records() ([]arrow.Record, error)
- func (t *ArrowTableChunked) Release()
- func (t *ArrowTableChunked) Retain()
- func (t *ArrowTableChunked) RowData(i int) (map[string]any, bool)
- func (t *ArrowTableChunked) SetInfo(info string)
- type ArrowTableStream
- func (t *ArrowTableStream) DecodeMsgpack(dec *msgpack.Decoder) error
- func (t *ArrowTableStream) EncodeMsgpack(enc *msgpack.Encoder) error
- func (t *ArrowTableStream) Info() string
- func (t *ArrowTableStream) MarshalJSON() ([]byte, error)
- func (t *ArrowTableStream) Reader(retain bool) (array.RecordReader, error)
- func (t *ArrowTableStream) Records() ([]arrow.Record, error)
- func (t *ArrowTableStream) Release()
- func (t *ArrowTableStream) Retain()
- func (t *ArrowTableStream) SetInfo(info string)
- type Config
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) DBConn() *sql.Conn
- func (c *Connection) Exec(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (c *Connection) Query(ctx context.Context, query string, args ...any) (*sql.Rows, error)
- func (c *Connection) QueryRow(ctx context.Context, query string, args ...any) *sql.Row
- type JsonValue
- type Pool
- func (p *Pool) Arrow(ctx context.Context) (*Arrow, error)
- func (p *Pool) Close() error
- func (p *Pool) Commit(ctx context.Context) error
- func (p *Pool) Conn(ctx context.Context) (*Connection, error)
- func (p *Pool) Connector() *duckdb.Connector
- func (p *Pool) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (p *Pool) IsTxContext(ctx context.Context) bool
- func (db *Pool) QueryArrowTable(ctx context.Context, q string, wrap bool, params ...any) (any, error)
- func (db *Pool) QueryJsonRow(ctx context.Context, q string, params ...any) (*JsonValue, error)
- func (db *Pool) QueryJsonScalarArray(ctx context.Context, q string, params ...any) (any, error)
- func (db *Pool) QueryJsonScalarArrayArrow(ctx context.Context, q string, params ...any) (ArrowTable, error)
- func (db *Pool) QueryJsonTableArrow(ctx context.Context, q string, wrap bool, params ...any) (ArrowTable, error)
- func (db *Pool) QueryRowToData(ctx context.Context, data any, q string, params ...any) error
- func (db *Pool) QueryScalarValue(ctx context.Context, q string, params ...any) (any, error)
- func (db *Pool) QueryTableToSlice(ctx context.Context, data any, q string, params ...any) error
- func (p *Pool) RegisterScalarFunction(ctx context.Context, function ScalarFunction) error
- func (p *Pool) RegisterScalarFunctionSet(ctx context.Context, set ScalarFunctionSet) error
- func (p *Pool) RegisterTableRowFunction(ctx context.Context, function TableRowFunction) error
- func (p *Pool) Rollback(ctx context.Context) error
- func (p *Pool) SetMaxIdleConns(n int)
- func (p *Pool) SetMaxOpenConns(n int)
- func (p *Pool) WithTx(parent context.Context) (context.Context, error)
- type ScalarFunction
- type ScalarFunctionCaster
- type ScalarFunctionNoArgs
- type ScalarFunctionSet
- type ScalarFunctionSetItem
- type ScalarFunctionSetItemNoArgs
- type ScalarFunctionTypedSet
- type ScalarFunctionWithArgs
- type ScriptDBType
- type Settings
- type TableRowFunction
- type TableRowFunctionNoArgs
- type TableRowFunctionWithArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseSQLScriptTemplate ¶ added in v0.1.9
func ParseSQLScriptTemplate(dbType ScriptDBType, script string) (string, error)
func RecordsColNums ¶ added in v0.1.16
func RecordsRowNums ¶ added in v0.1.16
func RegisterScalarFunction ¶ added in v0.1.9
func RegisterScalarFunction(ctx context.Context, db *Pool, function ScalarFunction) error
func RegisterScalarFunctionSet ¶ added in v0.1.9
func RegisterScalarFunctionSet(ctx context.Context, db *Pool, set ScalarFunctionSet) error
func RegisterTableRowFunction ¶ added in v0.1.9
func RegisterTableRowFunction(ctx context.Context, db *Pool, function TableRowFunction) error
func ReleaseRecords ¶ added in v0.1.16
func RetainRecords ¶ added in v0.1.16
Types ¶
type ArrowTable ¶ added in v0.1.5
type ArrowTableChunked ¶ added in v0.1.16
type ArrowTableChunked struct {
// contains filtered or unexported fields
}
func NewArrowTable ¶ added in v0.1.9
func NewArrowTable() *ArrowTableChunked
func NewArrowTableFromReader ¶ added in v0.1.18
func NewArrowTableFromReader(reader array.RecordReader) *ArrowTableChunked
func (*ArrowTableChunked) Append ¶ added in v0.1.16
func (t *ArrowTableChunked) Append(rec arrow.Record)
func (*ArrowTableChunked) Chunk ¶ added in v0.1.16
func (t *ArrowTableChunked) Chunk(i int) arrow.Record
func (*ArrowTableChunked) DecodeMsgpack ¶ added in v0.1.16
func (t *ArrowTableChunked) DecodeMsgpack(dec *msgpack.Decoder) error
func (*ArrowTableChunked) EncodeMsgpack ¶ added in v0.1.16
func (t *ArrowTableChunked) EncodeMsgpack(enc *msgpack.Encoder) error
func (*ArrowTableChunked) Info ¶ added in v0.1.16
func (t *ArrowTableChunked) Info() string
func (*ArrowTableChunked) MarshalJSON ¶ added in v0.1.16
func (t *ArrowTableChunked) MarshalJSON() ([]byte, error)
func (*ArrowTableChunked) NumChunks ¶ added in v0.1.16
func (t *ArrowTableChunked) NumChunks() int
func (*ArrowTableChunked) NumCols ¶ added in v0.1.16
func (t *ArrowTableChunked) NumCols() int
func (*ArrowTableChunked) NumRows ¶ added in v0.1.16
func (t *ArrowTableChunked) NumRows() int
func (*ArrowTableChunked) Reader ¶ added in v0.1.16
func (t *ArrowTableChunked) Reader(retain bool) (array.RecordReader, error)
func (*ArrowTableChunked) Records ¶ added in v0.1.16
func (t *ArrowTableChunked) Records() ([]arrow.Record, error)
func (*ArrowTableChunked) Release ¶ added in v0.1.16
func (t *ArrowTableChunked) Release()
func (*ArrowTableChunked) Retain ¶ added in v0.1.16
func (t *ArrowTableChunked) Retain()
func (*ArrowTableChunked) RowData ¶ added in v0.1.16
func (t *ArrowTableChunked) RowData(i int) (map[string]any, bool)
func (*ArrowTableChunked) SetInfo ¶ added in v0.1.16
func (t *ArrowTableChunked) SetInfo(info string)
type ArrowTableStream ¶ added in v0.1.16
type ArrowTableStream struct {
// contains filtered or unexported fields
}
func NewArrowTableStream ¶ added in v0.1.16
func NewArrowTableStream(reader array.RecordReader) *ArrowTableStream
func (*ArrowTableStream) DecodeMsgpack ¶ added in v0.1.16
func (t *ArrowTableStream) DecodeMsgpack(dec *msgpack.Decoder) error
func (*ArrowTableStream) EncodeMsgpack ¶ added in v0.1.16
func (t *ArrowTableStream) EncodeMsgpack(enc *msgpack.Encoder) error
func (*ArrowTableStream) Info ¶ added in v0.1.16
func (t *ArrowTableStream) Info() string
func (*ArrowTableStream) MarshalJSON ¶ added in v0.1.16
func (t *ArrowTableStream) MarshalJSON() ([]byte, error)
func (*ArrowTableStream) Reader ¶ added in v0.1.16
func (t *ArrowTableStream) Reader(retain bool) (array.RecordReader, error)
func (*ArrowTableStream) Records ¶ added in v0.1.16
func (t *ArrowTableStream) Records() ([]arrow.Record, error)
func (*ArrowTableStream) Release ¶ added in v0.1.16
func (t *ArrowTableStream) Release()
func (*ArrowTableStream) Retain ¶ added in v0.1.16
func (t *ArrowTableStream) Retain()
func (*ArrowTableStream) SetInfo ¶ added in v0.1.16
func (t *ArrowTableStream) SetInfo(info string)
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) DBConn ¶
func (c *Connection) DBConn() *sql.Conn
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) QueryArrowTable ¶ added in v0.1.5
func (*Pool) QueryJsonRow ¶
func (*Pool) QueryJsonScalarArray ¶
func (*Pool) QueryJsonScalarArrayArrow ¶
func (*Pool) QueryJsonTableArrow ¶
func (*Pool) QueryRowToData ¶
func (*Pool) QueryScalarValue ¶ added in v0.1.9
func (*Pool) QueryTableToSlice ¶
func (*Pool) RegisterScalarFunction ¶ added in v0.1.9
func (p *Pool) RegisterScalarFunction(ctx context.Context, function ScalarFunction) error
func (*Pool) RegisterScalarFunctionSet ¶ added in v0.1.9
func (p *Pool) RegisterScalarFunctionSet(ctx context.Context, set ScalarFunctionSet) error
func (*Pool) RegisterTableRowFunction ¶ added in v0.1.9
func (p *Pool) RegisterTableRowFunction(ctx context.Context, function TableRowFunction) error
func (*Pool) SetMaxIdleConns ¶
func (*Pool) SetMaxOpenConns ¶
type ScalarFunction ¶ added in v0.1.9
type ScalarFunctionCaster ¶ added in v0.1.9
type ScalarFunctionCaster[O any] interface { ScalarUDF(set *ScalarFunctionTypedSet[O]) ScalarFunction }
type ScalarFunctionNoArgs ¶ added in v0.1.9
type ScalarFunctionNoArgs[O any] struct { Name string Execute func(ctx context.Context) (O, error) ConvertOutput func(out O) (any, error) OutputType duckdb.TypeInfo IsVolatile bool }
func (*ScalarFunctionNoArgs[O]) Config ¶ added in v0.1.9
func (f *ScalarFunctionNoArgs[O]) Config() duckdb.ScalarFuncConfig
func (*ScalarFunctionNoArgs[O]) FuncName ¶ added in v0.1.9
func (f *ScalarFunctionNoArgs[O]) FuncName() string
type ScalarFunctionSet ¶ added in v0.1.9
type ScalarFunctionSetItem ¶ added in v0.1.9
type ScalarFunctionSetItem[I any, O any] struct { Execute func(ctx context.Context, input I) (O, error) ConvertInput func(args []driver.Value) (I, error) InputTypes []duckdb.TypeInfo }
func (*ScalarFunctionSetItem[I, O]) ScalarUDF ¶ added in v0.1.9
func (f *ScalarFunctionSetItem[I, O]) ScalarUDF(set *ScalarFunctionTypedSet[O]) ScalarFunction
type ScalarFunctionSetItemNoArgs ¶ added in v0.1.9
func (*ScalarFunctionSetItemNoArgs[O]) ScalarUDF ¶ added in v0.1.9
func (f *ScalarFunctionSetItemNoArgs[O]) ScalarUDF(set *ScalarFunctionTypedSet[O]) ScalarFunction
type ScalarFunctionTypedSet ¶ added in v0.1.9
type ScalarFunctionTypedSet[O any] struct { Name string Funcs []ScalarFunctionCaster[O] ConvertOutput func(out O) (any, error) OutputType duckdb.TypeInfo IsVolatile bool IsSpecialNullHandling bool }
func (*ScalarFunctionTypedSet[O]) FuncName ¶ added in v0.1.9
func (s *ScalarFunctionTypedSet[O]) FuncName() string
type ScalarFunctionWithArgs ¶ added in v0.1.9
type ScalarFunctionWithArgs[I any, O any] struct { Name string Execute func(ctx context.Context, input I) (O, error) ConvertInput func(args []driver.Value) (I, error) ConvertOutput func(out O) (any, error) InputTypes []duckdb.TypeInfo OutputType duckdb.TypeInfo IsVolatile bool IsSpecialNullHandling bool }
func (*ScalarFunctionWithArgs[I, O]) Config ¶ added in v0.1.9
func (f *ScalarFunctionWithArgs[I, O]) Config() duckdb.ScalarFuncConfig
func (*ScalarFunctionWithArgs[I, O]) FuncName ¶ added in v0.1.9
func (f *ScalarFunctionWithArgs[I, O]) FuncName() string
type ScriptDBType ¶ added in v0.1.9
type ScriptDBType string
const ( SDBPostgres ScriptDBType = "postgres" SDBDuckDB ScriptDBType = "duckdb" SDBAttachedDuckDB ScriptDBType = "attached_duckdb" SDBAttachedPostgres ScriptDBType = "attached_postgres" )
type Settings ¶
type Settings struct { AllowedDirectories []string `json:"allowed_directories"` AllowedPaths []string `json:"allowed_paths"` EnableLogging bool `json:"enable_logging"` MaxMemory int `json:"max_memory"` MaxTempDirectorySize int `json:"max_temp_directory_size"` TempDirectory string `json:"temp_directory"` WorkerThreads int `json:"worker_threads"` HomeDirectory string `json:"home_directory"` // POSTGRESQL PGConnectionLimit int `json:"pg_connection_limit"` PGPagesPerTask int `json:"pg_pages_per_task"` }
type TableRowFunction ¶ added in v0.1.9
type TableRowFunctionNoArgs ¶ added in v0.1.9
type TableRowFunctionNoArgs[O any] struct { Name string Execute func(ctx context.Context) ([]O, error) ColumnInfos []duckdb.ColumnInfo FillRow func(out O, row duckdb.Row) error }
func (*TableRowFunctionNoArgs[O]) Bind ¶ added in v0.1.9
func (f *TableRowFunctionNoArgs[O]) Bind(ctx context.Context) duckdb.RowTableFunction
func (*TableRowFunctionNoArgs[O]) FuncName ¶ added in v0.1.9
func (f *TableRowFunctionNoArgs[O]) FuncName() string
type TableRowFunctionWithArgs ¶ added in v0.1.9
type TableRowFunctionWithArgs[I any, O any] struct { Name string Execute func(ctx context.Context, input I) ([]O, error) Arguments []duckdb.TypeInfo NamedArguments map[string]duckdb.TypeInfo ConvertArgs func(named map[string]any, args ...any) (I, error) ColumnInfos []duckdb.ColumnInfo FillRow func(out O, row duckdb.Row) error }
func (*TableRowFunctionWithArgs[I, O]) Bind ¶ added in v0.1.9
func (f *TableRowFunctionWithArgs[I, O]) Bind(ctx context.Context) duckdb.RowTableFunction
func (*TableRowFunctionWithArgs[I, O]) FuncName ¶ added in v0.1.9
func (f *TableRowFunctionWithArgs[I, O]) FuncName() string
Click to show internal directories.
Click to hide internal directories.