Documentation
¶
Index ¶
- func AddTableView(ctx context.Context, tableName string, db *DuckDb, filters ...string) error
- func AddTableViews(ctx context.Context, db *DuckDb, filters ...string) error
- func EnsureDatabaseFile(ctx context.Context) error
- func GetRowCount(ctx context.Context, tableName string, partitionName *string) (int64, error)
- func GetTableViewSchema(ctx context.Context, viewName string) (map[string]string, error)
- func GetTableViews(ctx context.Context) ([]string, error)
- func ListPartitions(ctx context.Context) ([]string, error)
- type DuckDb
- func (d *DuckDb) Exec(query string, args ...any) (sql.Result, error)
- func (d *DuckDb) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (d *DuckDb) GetTempDir() string
- func (d *DuckDb) Query(query string, args ...any) (*sql.Rows, error)
- func (d *DuckDb) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
- func (d *DuckDb) QueryRow(query string, args ...any) *sql.Row
- func (d *DuckDb) QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
- type DuckDbOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTableView ¶
func AddTableViews ¶
AddTableViews creates a view for each table in the data directory, applying the provided duck db filters to the view query
func EnsureDatabaseFile ¶
func GetRowCount ¶
func GetTableViewSchema ¶
Types ¶
type DuckDb ¶ added in v0.2.0
DuckDb provides a wrapper around the sql.DB connection to DuckDB with enhanced error handling for invalid parquet files. It automatically retries operations when encountering invalid parquet files, which can occur when files are being written concurrently. The wrapper also handles installation and loading of required DuckDB extensions, and manages the connection lifecycle.
func (*DuckDb) ExecContext ¶ added in v0.2.0
func (*DuckDb) GetTempDir ¶ added in v0.4.0
GetTempDir returns the temporary directory configured for DuckDB operations
func (*DuckDb) QueryContext ¶ added in v0.2.0
type DuckDbOpt ¶ added in v0.2.0
type DuckDbOpt func(*DuckDb)
DuckDbOpt is a function type that modifies a DuckDb instance. It's used to configure DuckDb instances with different options like extensions, database file, and temp directory.
func WithDbFile ¶ added in v0.2.0
WithDbFile sets the database file path for the DuckDb instance. This can be used to specify a persistent database file or an in-memory database.
func WithDuckDbExtensions ¶ added in v0.2.0
WithDuckDbExtensions sets the list of DuckDB extensions to be installed and loaded. These extensions will be installed and loaded when the DuckDb instance is created.
func WithMaxMemoryMb ¶ added in v0.4.0
WithMaxMemoryMb sets the maximum memory limit for DuckDB. This can be used to control the memory usage of DuckDB operations.
func WithTempDir ¶ added in v0.2.0
WithTempDir sets the temporary directory for DuckDB operations. This directory is used for temporary files during database operations. If not specified, the collection temp directory will be used.