duckdb_go_bindings

package module
v0.1.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddReplacementScan

func AddReplacementScan(db Database, callbackPtr unsafe.Pointer, extraData unsafe.Pointer, deleteCallbackPtr unsafe.Pointer)

func AppenderError

func AppenderError(appender Appender) string

func BindAddResultColumn

func BindAddResultColumn(info BindInfo, name string, logicalType LogicalType)

func BindGetExtraInfo

func BindGetExtraInfo(info BindInfo) unsafe.Pointer

func BindSetBindData

func BindSetBindData(info BindInfo, bindDataPtr unsafe.Pointer, callbackPtr unsafe.Pointer)

func BindSetCardinality

func BindSetCardinality(info BindInfo, cardinality IdxT, exact bool)

func BindSetError

func BindSetError(info BindInfo, err string)

func Close

func Close(db *Database)

Close wraps duckdb_close.

func ColumnName

func ColumnName(res *Result, col IdxT) string

func ConfigCount

func ConfigCount() uint64

func ConnectionGetClientContext

func ConnectionGetClientContext(conn Connection, outCtx *ClientContext)

ConnectionGetClientContext wraps duckdb_connection_get_client_context. outCtx must be destroyed with DestroyClientContext.

func DataChunkReset

func DataChunkReset(chunk DataChunk)

func DataChunkSetSize

func DataChunkSetSize(chunk DataChunk, size IdxT)

func DateMembers

func DateMembers(date *Date) int32

DateMembers returns the days of a duckdb_date.

func DateStructMembers

func DateStructMembers(date *DateStruct) (int32, int8, int8)

DateStructMembers returns the year, month, and day of a duckdb_date.

func DecimalScale

func DecimalScale(logicalType LogicalType) uint8

func DecimalToDouble

func DecimalToDouble(d Decimal) float64

func DecimalWidth

func DecimalWidth(logicalType LogicalType) uint8

func DestroyArrow

func DestroyArrow(arrow *Arrow)

DestroyArrow wraps duckdb_destroy_arrow.

func DestroyBit

func DestroyBit(b *Bit)

DestroyBit destroys the data field of duckdb_bit.

func DestroyBlob

func DestroyBlob(b *Blob)

DestroyBlob destroys the data field of duckdb_blob.

func DestroyClientContext

func DestroyClientContext(ctx *ClientContext)

DestroyClientContext wraps duckdb_destroy_client_context.

func DestroyConfig

func DestroyConfig(config *Config)

DestroyConfig wraps duckdb_destroy_config.

func DestroyDataChunk

func DestroyDataChunk(chunk *DataChunk)

DestroyDataChunk wraps duckdb_destroy_data_chunk.

func DestroyExtracted

func DestroyExtracted(extractedStmts *ExtractedStatements)

DestroyExtracted wraps duckdb_destroy_extracted.

func DestroyInstanceCache

func DestroyInstanceCache(cache *InstanceCache)

DestroyInstanceCache wraps duckdb_destroy_instance_cache.

func DestroyLogicalType

func DestroyLogicalType(logicalType *LogicalType)

DestroyLogicalType wraps duckdb_destroy_logical_type.

func DestroyPending

func DestroyPending(pendingRes *PendingResult)

DestroyPending wraps duckdb_destroy_pending.

func DestroyPrepare

func DestroyPrepare(preparedStmt *PreparedStatement)

DestroyPrepare wraps duckdb_destroy_prepare.

func DestroyResult

func DestroyResult(res *Result)

DestroyResult wraps duckdb_destroy_result.

func DestroyScalarFunction

func DestroyScalarFunction(f *ScalarFunction)

DestroyScalarFunction wraps duckdb_destroy_scalar_function.

func DestroyScalarFunctionSet

func DestroyScalarFunctionSet(set *ScalarFunctionSet)

DestroyScalarFunctionSet wraps duckdb_destroy_scalar_function_set.

func DestroySelectionVector

func DestroySelectionVector(sel *SelectionVector)

DestroySelectionVector wraps duckdb_destroy_selection_vector.

func DestroyTableFunction

func DestroyTableFunction(f *TableFunction)

DestroyTableFunction wraps duckdb_destroy_table_function.

func DestroyValue

func DestroyValue(v *Value)

DestroyValue wraps duckdb_destroy_value.

func DestroyVarInt

func DestroyVarInt(i *VarInt)

DestroyVarInt destroys the data field of duckdb_varint.

func DestroyVector

func DestroyVector(vec *Vector)

DestroyVector wraps duckdb_destroy_vector.

func Disconnect

func Disconnect(conn *Connection)

Disconnect wraps duckdb_disconnect.

func EnumDictionarySize

func EnumDictionarySize(logicalType LogicalType) uint32

func EnumDictionaryValue

func EnumDictionaryValue(logicalType LogicalType, index IdxT) string

func ExtractStatementsError

func ExtractStatementsError(extractedStmts ExtractedStatements) string

func Free

func Free(ptr unsafe.Pointer)

func FunctionGetBindData

func FunctionGetBindData(info FunctionInfo) unsafe.Pointer

func FunctionGetExtraInfo

func FunctionGetExtraInfo(info FunctionInfo) unsafe.Pointer

func FunctionGetInitData

func FunctionGetInitData(info FunctionInfo) unsafe.Pointer

func FunctionGetLocalInitData

func FunctionGetLocalInitData(info FunctionInfo) unsafe.Pointer

func FunctionSetError

func FunctionSetError(info FunctionInfo, err string)

func GetAllocationCount

func GetAllocationCount(k string) (int, bool)

GetAllocationCount returns the value of an allocation count, and true, if it exists, otherwise zero, and false.

func GetAllocationCounts

func GetAllocationCounts() string

GetAllocationCounts returns the value of each non-zero allocation count.

func GetBool

func GetBool(v Value) bool

func GetDouble

func GetDouble(v Value) float64

func GetEnumValue

func GetEnumValue(v Value) uint64

func GetFloat

func GetFloat(v Value) float32

func GetInt16

func GetInt16(v Value) int16

func GetInt32

func GetInt32(v Value) int32

func GetInt64

func GetInt64(v Value) int64

func GetInt8

func GetInt8(v Value) int8

func GetUInt16

func GetUInt16(v Value) uint16

func GetUInt32

func GetUInt32(v Value) uint32

func GetUInt64

func GetUInt64(v Value) uint64

func GetUInt8

func GetUInt8(v Value) uint8

func GetVarchar

func GetVarchar(v Value) string

func HugeIntMembers

func HugeIntMembers(hi *HugeInt) (uint64, int64)

HugeIntMembers returns the lower and upper of a duckdb_hugeint.

func HugeIntToDouble

func HugeIntToDouble(hi HugeInt) float64

func InitGetBindData

func InitGetBindData(info InitInfo) unsafe.Pointer

func InitGetExtraInfo

func InitGetExtraInfo(info InitInfo) unsafe.Pointer

func InitSetError

func InitSetError(info InitInfo, err string)

func InitSetInitData

func InitSetInitData(info InitInfo, initDataPtr unsafe.Pointer, callbackPtr unsafe.Pointer)

func InitSetMaxThreads

func InitSetMaxThreads(info InitInfo, max IdxT)

func Interrupt

func Interrupt(conn Connection)

func IntervalMembers

func IntervalMembers(i *Interval) (int32, int32, int64)

IntervalMembers returns the months, days, and micros of a duckdb_interval.

func IsFiniteDate

func IsFiniteDate(date Date) bool

func IsFiniteTimestamp

func IsFiniteTimestamp(ts Timestamp) bool

func IsFiniteTimestampMS

func IsFiniteTimestampMS(ts TimestampMS) bool

func IsFiniteTimestampNS

func IsFiniteTimestampNS(ts TimestampNS) bool

func IsFiniteTimestampS

func IsFiniteTimestampS(ts TimestampS) bool

func IsNullValue

func IsNullValue(v Value) bool

func LibraryVersion

func LibraryVersion() string

func ListEntryMembers

func ListEntryMembers(entry *ListEntry) (uint64, uint64)

ListEntryMembers returns the offset and length of a duckdb_list_entry.

func LogicalTypeGetAlias

func LogicalTypeGetAlias(logicalType LogicalType) string

func LogicalTypeSetAlias

func LogicalTypeSetAlias(logicalType LogicalType, alias string)

func ParameterName

func ParameterName(preparedStmt PreparedStatement, index IdxT) string

func PendingError

func PendingError(pendingRes PendingResult) string

func PendingExecutionIsFinished

func PendingExecutionIsFinished(state PendingState) bool

func PrepareError

func PrepareError(preparedStmt PreparedStatement) string

func QueryArrowError

func QueryArrowError(arrow Arrow) string

func QueryProgressTypeMembers

func QueryProgressTypeMembers(q *QueryProgressType) (float64, uint64, uint64)

QueryProgressTypeMembers returns the percentage, rows_processed, and total_rows_to_process of a duckdb_query_progress_type.

func ReplacementScanAddParameter

func ReplacementScanAddParameter(info ReplacementScanInfo, v Value)

func ReplacementScanSetError

func ReplacementScanSetError(info ReplacementScanInfo, err string)

func ReplacementScanSetFunctionName

func ReplacementScanSetFunctionName(info ReplacementScanInfo, name string)

func ResultError

func ResultError(res *Result) string

func ScalarFunctionAddParameter

func ScalarFunctionAddParameter(f ScalarFunction, logicalType LogicalType)

func ScalarFunctionBindSetError

func ScalarFunctionBindSetError(info BindInfo, err string)

func ScalarFunctionGetBindData

func ScalarFunctionGetBindData(info FunctionInfo) unsafe.Pointer

func ScalarFunctionGetClientContext

func ScalarFunctionGetClientContext(info BindInfo, outCtx *ClientContext)

ScalarFunctionGetClientContext wraps duckdb_scalar_function_get_client_context. The return value must be destroyed with DestroyClientContext.

func ScalarFunctionGetExtraInfo

func ScalarFunctionGetExtraInfo(info FunctionInfo) unsafe.Pointer

func ScalarFunctionSetBind

func ScalarFunctionSetBind(f ScalarFunction, callbackPtr unsafe.Pointer)

func ScalarFunctionSetBindData

func ScalarFunctionSetBindData(info BindInfo, bindDataPtr unsafe.Pointer, callbackPtr unsafe.Pointer)

func ScalarFunctionSetError

func ScalarFunctionSetError(info FunctionInfo, err string)

func ScalarFunctionSetExtraInfo

func ScalarFunctionSetExtraInfo(f ScalarFunction, extraInfoPtr unsafe.Pointer, callbackPtr unsafe.Pointer)

func ScalarFunctionSetFunction

func ScalarFunctionSetFunction(f ScalarFunction, callbackPtr unsafe.Pointer)

func ScalarFunctionSetName

func ScalarFunctionSetName(f ScalarFunction, name string)

func ScalarFunctionSetReturnType

func ScalarFunctionSetReturnType(f ScalarFunction, logicalType LogicalType)

func ScalarFunctionSetSpecialHandling

func ScalarFunctionSetSpecialHandling(f ScalarFunction)

func ScalarFunctionSetVarargs

func ScalarFunctionSetVarargs(f ScalarFunction, logicalType LogicalType)

func ScalarFunctionSetVolatile

func ScalarFunctionSetVolatile(f ScalarFunction)

func SliceVector

func SliceVector(vec Vector, sel SelectionVector, len IdxT)

func StringIsInlined

func StringIsInlined(strT StringT) bool

func StringTData

func StringTData(strT *StringT) string

func StringTLength

func StringTLength(strT StringT) uint32

func StructTypeChildName

func StructTypeChildName(logicalType LogicalType, index IdxT) string

func TableDescriptionDestroy

func TableDescriptionDestroy(desc *TableDescription)

TableDescriptionDestroy wraps duckdb_table_description_destroy.

func TableDescriptionError

func TableDescriptionError(desc TableDescription) string

func TableDescriptionGetColumnName

func TableDescriptionGetColumnName(desc TableDescription, index IdxT) string

func TableFunctionAddNamedParameter

func TableFunctionAddNamedParameter(f TableFunction, name string, logicalType LogicalType)

func TableFunctionAddParameter

func TableFunctionAddParameter(f TableFunction, logicalType LogicalType)

func TableFunctionSetBind

func TableFunctionSetBind(f TableFunction, callbackPtr unsafe.Pointer)

func TableFunctionSetExtraInfo

func TableFunctionSetExtraInfo(f TableFunction, extraInfoPtr unsafe.Pointer, callbackPtr unsafe.Pointer)

func TableFunctionSetFunction

func TableFunctionSetFunction(f TableFunction, callbackPtr unsafe.Pointer)

func TableFunctionSetInit

func TableFunctionSetInit(f TableFunction, callbackPtr unsafe.Pointer)

func TableFunctionSetLocalInit

func TableFunctionSetLocalInit(f TableFunction, callbackPtr unsafe.Pointer)

func TableFunctionSetName

func TableFunctionSetName(f TableFunction, name string)

func TableFunctionSupportsProjectionPushdown

func TableFunctionSupportsProjectionPushdown(f TableFunction, pushdown bool)

func TimeMembers

func TimeMembers(ti *Time) int64

TimeMembers returns the micros of a duckdb_time.

func TimeStructMembers

func TimeStructMembers(ti *TimeStruct) (int8, int8, int8, int32)

TimeStructMembers returns the hour, min, sec, and micros of a duckdb_time_struct.

func TimeTZMembers

func TimeTZMembers(ti *TimeTZ) uint64

TimeTZMembers returns the bits of a duckdb_time_tz.

func TimestampMSMembers

func TimestampMSMembers(ts *TimestampMS) int64

TimestampMSMembers returns the millis of a duckdb_timestamp_ms.

func TimestampMembers

func TimestampMembers(ts *Timestamp) int64

TimestampMembers returns the micros of a duckdb_timestamp.

func TimestampNSMembers

func TimestampNSMembers(ts *TimestampNS) int64

TimestampNSMembers returns the nanos of a duckdb_timestamp_ns.

func TimestampSMembers

func TimestampSMembers(ts *TimestampS) int64

TimestampSMembers returns the seconds of a duckdb_timestamp_s.

func TimestampStructMembers

func TimestampStructMembers(ts *TimestampStruct) (DateStruct, TimeStruct)

TimestampStructMembers returns the date and time of a duckdb_timestamp_struct.

func UHugeIntMembers

func UHugeIntMembers(hi *UHugeInt) (uint64, uint64)

UHugeIntMembers returns the lower and upper of a duckdb_uhugeint.

func UHugeIntToDouble

func UHugeIntToDouble(hi UHugeInt) float64

func UnionTypeMemberName

func UnionTypeMemberName(logicalType LogicalType, index IdxT) string

func ValidityMaskValueIsValid

func ValidityMaskValueIsValid(maskPtr unsafe.Pointer, index IdxT) bool

func ValidityRowIsValid

func ValidityRowIsValid(maskPtr unsafe.Pointer, row IdxT) bool

func ValiditySetRowInvalid

func ValiditySetRowInvalid(maskPtr unsafe.Pointer, row IdxT)

func ValiditySetRowValid

func ValiditySetRowValid(maskPtr unsafe.Pointer, row IdxT)

func ValiditySetRowValidity

func ValiditySetRowValidity(maskPtr unsafe.Pointer, row IdxT, valid bool)

func ValueInt64

func ValueInt64(res *Result, col IdxT, row IdxT) int64

func ValueToString

func ValueToString(val Value) string

func VectorAssignStringElement

func VectorAssignStringElement(vec Vector, index IdxT, str string)

func VectorAssignStringElementLen

func VectorAssignStringElementLen(vec Vector, index IdxT, blob []byte)

func VectorEnsureValidityWritable

func VectorEnsureValidityWritable(vec Vector)

func VectorGetData

func VectorGetData(vec Vector) unsafe.Pointer

func VectorGetValidity

func VectorGetValidity(vec Vector) unsafe.Pointer

func VectorReferenceValue

func VectorReferenceValue(vec Vector, v Value)

func VectorReferenceVector

func VectorReferenceVector(toVec Vector, fromVec Vector)

func VerifyAllocationCounters

func VerifyAllocationCounters()

VerifyAllocationCounters verifies all allocation counters. This includes the instance cache, which should be kept alive as long as the application is kept alive, causing this verification to fail. If you're using the instance cache, use VerifyAllocationCounter instead.

Types

type Appender

type Appender struct {
	Ptr unsafe.Pointer
}

Appender wraps *duckdb_appender.

type Arrow

type Arrow struct {
	Ptr unsafe.Pointer
}

Arrow wraps *duckdb_arrow.

type ArrowArray

type ArrowArray struct {
	Ptr unsafe.Pointer
}

ArrowArray wraps *duckdb_arrow_array.

type ArrowSchema

type ArrowSchema struct {
	Ptr unsafe.Pointer
}

ArrowSchema wraps *duckdb_arrow_schema.

type ArrowStream

type ArrowStream struct {
	Ptr unsafe.Pointer
}

ArrowStream wraps *duckdb_arrow_stream.

type BindInfo

type BindInfo struct {
	Ptr unsafe.Pointer
}

BindInfo wraps *duckdb_bind_info.

type Bit

type Bit = C.duckdb_bit

Bit does not export New and Members. Use the respective Bit functions to access / write to this type. This type must be destroyed with DestroyBit.

func GetBit

func GetBit(v Value) Bit

GetBit wraps duckdb_get_bit. The return value must be destroyed with DestroyBit.

type Blob

type Blob = C.duckdb_blob

Blob does not export New and Members. Use the respective Blob functions to access / write to this type. This type must be destroyed with DestroyBlob.

func GetBlob

func GetBlob(v Value) Blob

GetBlob wraps duckdb_get_blob. The return value must be destroyed with DestroyBlob.

type CastMode

type CastMode = C.duckdb_cast_mode

CastMode wraps duckdb_cast_mode.

const (
	CastModeNormal CastMode = C.DUCKDB_CAST_NORMAL
	CastModeTry    CastMode = C.DUCKDB_CAST_TRY
)

type ClientContext

type ClientContext struct {
	Ptr unsafe.Pointer
}

ClientContext wraps *duckdb_client_context.

type Column

type Column struct {
	// contains filtered or unexported fields
}

Column wraps duckdb_column. NOTE: Same limitations as Result.

type Config

type Config struct {
	Ptr unsafe.Pointer
}

Config wraps *duckdb_config.

type Connection

type Connection struct {
	Ptr unsafe.Pointer
}

Connection wraps *duckdb_connection.

type CreateTypeInfo

type CreateTypeInfo struct {
	Ptr unsafe.Pointer
}

CreateTypeInfo wraps *duckdb_create_type_info.

type DataChunk

type DataChunk struct {
	Ptr unsafe.Pointer
}

DataChunk wraps *duckdb_data_chunk.

func CreateDataChunk

func CreateDataChunk(types []LogicalType) DataChunk

CreateDataChunk wraps duckdb_create_data_chunk. The return value must be destroyed with DestroyDataChunk.

func ResultGetChunk

func ResultGetChunk(res Result, index IdxT) DataChunk

ResultGetChunk wraps duckdb_result_get_chunk. The return value must be destroyed with DestroyDataChunk.

type Database

type Database struct {
	Ptr unsafe.Pointer
}

Database wraps *duckdb_database.

type Date

type Date = C.duckdb_date

func GetDate

func GetDate(v Value) Date

func NewDate

func NewDate(days int32) Date

NewDate sets the members of a duckdb_date.

func ToDate

func ToDate(date DateStruct) Date

type DateStruct

type DateStruct = C.duckdb_date_struct

func FromDate

func FromDate(date Date) DateStruct

func NewDateStruct

func NewDateStruct(year int32, month int8, day int8) DateStruct

NewDateStruct sets the members of a duckdb_date_struct.

type Decimal

type Decimal = C.duckdb_decimal

func DoubleToDecimal

func DoubleToDecimal(d float64, width uint8, scale uint8) Decimal

func GetDecimal

func GetDecimal(v Value) Decimal

func NewDecimal

func NewDecimal(width uint8, scale uint8, hi HugeInt) Decimal

NewDecimal sets the members of a duckdb_decimal.

type ErrorType

type ErrorType = C.duckdb_error_type

ErrorType wraps duckdb_error_type.

const (
	ErrorTypeInvalid              ErrorType = C.DUCKDB_ERROR_INVALID
	ErrorTypeOutOfRange           ErrorType = C.DUCKDB_ERROR_OUT_OF_RANGE
	ErrorTypeConversion           ErrorType = C.DUCKDB_ERROR_CONVERSION
	ErrorTypeUnknownType          ErrorType = C.DUCKDB_ERROR_UNKNOWN_TYPE
	ErrorTypeDecimal              ErrorType = C.DUCKDB_ERROR_DECIMAL
	ErrorTypeMismatchType         ErrorType = C.DUCKDB_ERROR_MISMATCH_TYPE
	ErrorTypeDivideByZero         ErrorType = C.DUCKDB_ERROR_DIVIDE_BY_ZERO
	ErrorTypeObjectSize           ErrorType = C.DUCKDB_ERROR_OBJECT_SIZE
	ErrorTypeInvalidType          ErrorType = C.DUCKDB_ERROR_INVALID_TYPE
	ErrorTypeSerialization        ErrorType = C.DUCKDB_ERROR_SERIALIZATION
	ErrorTypeTransaction          ErrorType = C.DUCKDB_ERROR_TRANSACTION
	ErrorTypeNotImplemented       ErrorType = C.DUCKDB_ERROR_NOT_IMPLEMENTED
	ErrorTypeExpression           ErrorType = C.DUCKDB_ERROR_EXPRESSION
	ErrorTypeCatalog              ErrorType = C.DUCKDB_ERROR_CATALOG
	ErrorTypeParser               ErrorType = C.DUCKDB_ERROR_PARSER
	ErrorTypePlanner              ErrorType = C.DUCKDB_ERROR_PLANNER
	ErrorTypeScheduler            ErrorType = C.DUCKDB_ERROR_SCHEDULER
	ErrorTypeExecutor             ErrorType = C.DUCKDB_ERROR_EXECUTOR
	ErrorTypeConstraint           ErrorType = C.DUCKDB_ERROR_CONSTRAINT
	ErrorTypeIndex                ErrorType = C.DUCKDB_ERROR_INDEX
	ErrorTypeStat                 ErrorType = C.DUCKDB_ERROR_STAT
	ErrorTypeConnection           ErrorType = C.DUCKDB_ERROR_CONNECTION
	ErrorTypeSyntax               ErrorType = C.DUCKDB_ERROR_SYNTAX
	ErrorTypeSettings             ErrorType = C.DUCKDB_ERROR_SETTINGS
	ErrorTypeBinder               ErrorType = C.DUCKDB_ERROR_BINDER
	ErrorTypeNetwork              ErrorType = C.DUCKDB_ERROR_NETWORK
	ErrorTypeOptimizer            ErrorType = C.DUCKDB_ERROR_OPTIMIZER
	ErrorTypeNullPointer          ErrorType = C.DUCKDB_ERROR_NULL_POINTER
	ErrorTypeErrorIO              ErrorType = C.DUCKDB_ERROR_IO
	ErrorTypeInterrupt            ErrorType = C.DUCKDB_ERROR_INTERRUPT
	ErrorTypeFatal                ErrorType = C.DUCKDB_ERROR_FATAL
	ErrorTypeInternal             ErrorType = C.DUCKDB_ERROR_INTERNAL
	ErrorTypeInvalidInput         ErrorType = C.DUCKDB_ERROR_INVALID_INPUT
	ErrorTypeOutOfMemory          ErrorType = C.DUCKDB_ERROR_OUT_OF_MEMORY
	ErrorTypePermission           ErrorType = C.DUCKDB_ERROR_PERMISSION
	ErrorTypeParameterNotResolved ErrorType = C.DUCKDB_ERROR_PARAMETER_NOT_RESOLVED
	ErrorTypeParameterNotAllowed  ErrorType = C.DUCKDB_ERROR_PARAMETER_NOT_ALLOWED
	ErrorTypeDependency           ErrorType = C.DUCKDB_ERROR_DEPENDENCY
	ErrorTypeHTTP                 ErrorType = C.DUCKDB_ERROR_HTTP
	ErrorTypeMissingExtension     ErrorType = C.DUCKDB_ERROR_MISSING_EXTENSION
	ErrorTypeAutoload             ErrorType = C.DUCKDB_ERROR_AUTOLOAD
	ErrorTypeSequence             ErrorType = C.DUCKDB_ERROR_SEQUENCE
	ErrorTypeInvalidConfiguration ErrorType = C.DUCKDB_INVALID_CONFIGURATION
)

func ResultErrorType

func ResultErrorType(res *Result) ErrorType

type ExtractedStatements

type ExtractedStatements struct {
	Ptr unsafe.Pointer
}

ExtractedStatements wraps *duckdb_extracted_statements.

type FunctionInfo

type FunctionInfo struct {
	Ptr unsafe.Pointer
}

FunctionInfo wraps *duckdb_function_info.

type HugeInt

type HugeInt = C.duckdb_hugeint

func DecimalMembers

func DecimalMembers(d *Decimal) (uint8, uint8, HugeInt)

DecimalMembers returns the width, scale, and value of a duckdb_decimal.

func DoubleToHugeInt

func DoubleToHugeInt(d float64) HugeInt

func GetHugeInt

func GetHugeInt(v Value) HugeInt

func NewHugeInt

func NewHugeInt(lower uint64, upper int64) HugeInt

NewHugeInt sets the members of a duckdb_hugeint.

type IdxT

type IdxT = C.idx_t

func AppenderColumnCount

func AppenderColumnCount(appender Appender) IdxT

func ArrayTypeArraySize

func ArrayTypeArraySize(logicalType LogicalType) IdxT

func ArrowRowCount

func ArrowRowCount(arrow Arrow) IdxT

func BindGetParameterCount

func BindGetParameterCount(info BindInfo) IdxT

func ClientContextGetConnectionId

func ClientContextGetConnectionId(ctx ClientContext) IdxT

func ColumnCount

func ColumnCount(res *Result) IdxT

func DataChunkGetColumnCount

func DataChunkGetColumnCount(chunk DataChunk) IdxT

func DataChunkGetSize

func DataChunkGetSize(chunk DataChunk) IdxT

func ExtractStatements

func ExtractStatements(conn Connection, query string, outExtractedStmts *ExtractedStatements) IdxT

ExtractStatements wraps duckdb_extract_statements. outExtractedStmts must be destroyed with DestroyExtracted.

func GetListSize

func GetListSize(v Value) IdxT

func GetMapSize

func GetMapSize(v Value) IdxT

func InitGetColumnCount

func InitGetColumnCount(info InitInfo) IdxT

func InitGetColumnIndex

func InitGetColumnIndex(info InitInfo, index IdxT) IdxT

func ListVectorGetSize

func ListVectorGetSize(vec Vector) IdxT

func NParams

func NParams(preparedStmt PreparedStatement) IdxT

func ProfilingInfoGetChildCount

func ProfilingInfoGetChildCount(info ProfilingInfo) IdxT

func ResultChunkCount

func ResultChunkCount(res Result) IdxT

func RowsChanged

func RowsChanged(res *Result) IdxT

func StructTypeChildCount

func StructTypeChildCount(logicalType LogicalType) IdxT

func UnionTypeMemberCount

func UnionTypeMemberCount(logicalType LogicalType) IdxT

func VectorSize

func VectorSize() IdxT

type InitInfo

type InitInfo struct {
	Ptr unsafe.Pointer
}

InitInfo wraps *C.duckdb_init_info.

type InstanceCache

type InstanceCache struct {
	Ptr unsafe.Pointer
}

InstanceCache wraps *duckdb_instance_cache.

func CreateInstanceCache

func CreateInstanceCache() InstanceCache

CreateInstanceCache wraps duckdb_create_instance_cache. The return value must be destroyed with DestroyInstanceCache.

type Interval

type Interval = C.duckdb_interval

func GetInterval

func GetInterval(v Value) Interval

func NewInterval

func NewInterval(months int32, days int32, micros int64) Interval

NewInterval sets the members of a duckdb_interval.

type ListEntry

type ListEntry = C.duckdb_list_entry

func NewListEntry

func NewListEntry(offset uint64, length uint64) ListEntry

NewListEntry sets the members of a duckdb_list_entry.

type LogicalType

type LogicalType struct {
	Ptr unsafe.Pointer
}

LogicalType wraps *duckdb_logical_type.

func AppenderColumnType

func AppenderColumnType(appender Appender, index IdxT) LogicalType

AppenderColumnType wraps duckdb_appender_column_type. The return value must be destroyed with DestroyLogicalType.

func ArrayTypeChildType

func ArrayTypeChildType(logicalType LogicalType) LogicalType

ArrayTypeChildType wraps duckdb_array_type_child_type. The return value must be destroyed with DestroyLogicalType.

func ColumnLogicalType

func ColumnLogicalType(res *Result, col IdxT) LogicalType

ColumnLogicalType wraps duckdb_column_logical_type. The return value must be destroyed with DestroyLogicalType.

func CreateArrayType

func CreateArrayType(child LogicalType, size IdxT) LogicalType

CreateArrayType wraps duckdb_create_array_type. The return value must be destroyed with DestroyLogicalType.

func CreateDecimalType

func CreateDecimalType(width uint8, scale uint8) LogicalType

CreateDecimalType wraps duckdb_create_decimal_type. The return value must be destroyed with DestroyLogicalType.

func CreateEnumType

func CreateEnumType(names []string) LogicalType

CreateEnumType wraps duckdb_create_enum_type. The return value must be destroyed with DestroyLogicalType.

func CreateListType

func CreateListType(child LogicalType) LogicalType

CreateListType wraps duckdb_create_list_type. The return value must be destroyed with DestroyLogicalType.

func CreateLogicalType

func CreateLogicalType(t Type) LogicalType

CreateLogicalType wraps duckdb_create_logical_type. The return value must be destroyed with DestroyLogicalType.

func CreateMapType

func CreateMapType(key LogicalType, value LogicalType) LogicalType

CreateMapType wraps duckdb_create_map_type. The return value must be destroyed with DestroyLogicalType.

func CreateStructType

func CreateStructType(types []LogicalType, names []string) LogicalType

CreateStructType wraps duckdb_create_struct_type. The return value must be destroyed with DestroyLogicalType.

func CreateUnionType

func CreateUnionType(types []LogicalType, names []string) LogicalType

CreateUnionType wraps duckdb_create_union_type. The return value must be destroyed with DestroyLogicalType.

func GetValueType

func GetValueType(v Value) LogicalType

GetValueType wraps duckdb_get_value_type. The return value must be destroyed with DestroyLogicalType.

func ListTypeChildType

func ListTypeChildType(logicalType LogicalType) LogicalType

ListTypeChildType wraps duckdb_list_type_child_type. The return value must be destroyed with DestroyLogicalType.

func MapTypeKeyType

func MapTypeKeyType(logicalType LogicalType) LogicalType

MapTypeKeyType wraps duckdb_map_type_key_type. The return value must be destroyed with DestroyLogicalType.

func MapTypeValueType

func MapTypeValueType(logicalType LogicalType) LogicalType

MapTypeValueType wraps duckdb_map_type_value_type. The return value must be destroyed with DestroyLogicalType.

func ParamLogicalType

func ParamLogicalType(preparedStmt PreparedStatement, index IdxT) LogicalType

ParamLogicalType wraps duckdb_param_logical_type. The return value must be destroyed with DestroyLogicalType.

func StructTypeChildType

func StructTypeChildType(logicalType LogicalType, index IdxT) LogicalType

StructTypeChildType wraps duckdb_struct_type_child_type. The return value must be destroyed with DestroyLogicalType.

func UnionTypeMemberType

func UnionTypeMemberType(logicalType LogicalType, index IdxT) LogicalType

UnionTypeMemberType wraps duckdb_union_type_member_type. The return value must be destroyed with DestroyLogicalType.

func VectorGetColumnType

func VectorGetColumnType(vec Vector) LogicalType

VectorGetColumnType wraps duckdb_vector_get_column_type. The return value must be destroyed with DestroyLogicalType.

type PendingResult

type PendingResult struct {
	Ptr unsafe.Pointer
}

PendingResult wraps *duckdb_pending_result.

type PendingState

type PendingState = C.duckdb_pending_state

PendingState wraps duckdb_pending_state.

const (
	PendingStateResultReady      PendingState = C.DUCKDB_PENDING_RESULT_READY
	PendingStateResultNotReady   PendingState = C.DUCKDB_PENDING_RESULT_NOT_READY
	PendingStateError            PendingState = C.DUCKDB_PENDING_ERROR
	PendingStateNoTasksAvailable PendingState = C.DUCKDB_PENDING_NO_TASKS_AVAILABLE
)

func PendingExecuteCheckState

func PendingExecuteCheckState(pendingRes PendingResult) PendingState

func PendingExecuteTask

func PendingExecuteTask(pendingRes PendingResult) PendingState

type PreparedStatement

type PreparedStatement struct {
	Ptr unsafe.Pointer
}

PreparedStatement wraps *duckdb_prepared_statement.

type ProfilingInfo

type ProfilingInfo struct {
	Ptr unsafe.Pointer
}

ProfilingInfo wraps *duckdb_profiling_info.

func GetProfilingInfo

func GetProfilingInfo(conn Connection) ProfilingInfo

func ProfilingInfoGetChild

func ProfilingInfoGetChild(info ProfilingInfo, index IdxT) ProfilingInfo

type QueryProgressType

type QueryProgressType = C.duckdb_query_progress_type

func NewQueryProgressType

func NewQueryProgressType(percentage float64, rowsProcessed uint64, totalRowsToProcess uint64) QueryProgressType

NewQueryProgressType sets the members of a duckdb_query_progress_type.

func QueryProgress

func QueryProgress(conn Connection) QueryProgressType

type ReplacementScanInfo

type ReplacementScanInfo struct {
	Ptr unsafe.Pointer
}

ReplacementScanInfo wraps *duckdb_replacement_scan.

type Result

type Result struct {
	// contains filtered or unexported fields
}

Result wraps duckdb_result. NOTE: Using 'type Result = C.duckdb_result' causes a somewhat mysterious 'runtime error: cgo argument has Go pointer to unpinned Go pointer'. See https://github.com/golang/go/issues/28606#issuecomment-2184269962. When using a type alias, duckdb_result itself contains a Go unsafe.Pointer for its 'void *internal_data' field.

type ResultType

type ResultType = C.duckdb_result_type

ResultType wraps duckdb_result_type.

const (
	ResultTypeInvalid     ResultType = C.DUCKDB_RESULT_TYPE_INVALID
	ResultTypeChangedRows ResultType = C.DUCKDB_RESULT_TYPE_CHANGED_ROWS
	ResultTypeNothing     ResultType = C.DUCKDB_RESULT_TYPE_NOTHING
	ResultTypeQueryResult ResultType = C.DUCKDB_RESULT_TYPE_QUERY_RESULT
)

func ResultReturnType

func ResultReturnType(res Result) ResultType

type ScalarFunction

type ScalarFunction struct {
	Ptr unsafe.Pointer
}

ScalarFunction wraps *duckdb_scalar_function.

func CreateScalarFunction

func CreateScalarFunction() ScalarFunction

CreateScalarFunction wraps duckdb_create_scalar_function. The return value must be destroyed with DestroyScalarFunction.

type ScalarFunctionSet

type ScalarFunctionSet struct {
	Ptr unsafe.Pointer
}

ScalarFunctionSet wraps *duckdb_scalar_function_set.

func CreateScalarFunctionSet

func CreateScalarFunctionSet(name string) ScalarFunctionSet

CreateScalarFunctionSet wraps duckdb_create_scalar_function_set. The return value must be destroyed with DestroyScalarFunctionSet.

type SelT

type SelT = C.sel_t

func SelectionVectorGetDataPtr

func SelectionVectorGetDataPtr(sel SelectionVector) *SelT

type SelectionVector

type SelectionVector struct {
	Ptr unsafe.Pointer
}

SelectionVector wraps *duckdb_selection_vector.

func CreateSelectionVector

func CreateSelectionVector(size IdxT) SelectionVector

CreateSelectionVector wraps duckdb_create_selection_vector. The return value must be destroyed with DestroySelectionVector.

type State

type State = C.duckdb_state

State wraps duckdb_state.

const (
	StateSuccess State = C.DuckDBSuccess
	StateError   State = C.DuckDBError
)

func AddScalarFunctionToSet

func AddScalarFunctionToSet(set ScalarFunctionSet, f ScalarFunction) State

func AppendDataChunk

func AppendDataChunk(appender Appender, chunk DataChunk) State

func AppendDefaultToChunk

func AppendDefaultToChunk(appender Appender, chunk DataChunk, col IdxT, row IdxT) State

func AppenderAddColumn

func AppenderAddColumn(appender Appender, name string) State

func AppenderClearColumns

func AppenderClearColumns(appender Appender) State

func AppenderClose

func AppenderClose(appender Appender) State

func AppenderCreate

func AppenderCreate(conn Connection, schema string, table string, outAppender *Appender) State

AppenderCreate wraps duckdb_appender_create. outAppender must be destroyed with AppenderDestroy.

func AppenderCreateExt

func AppenderCreateExt(conn Connection, catalog string, schema string, table string, outAppender *Appender) State

AppenderCreateExt wraps duckdb_appender_create_ext. outAppender must be destroyed with AppenderDestroy.

func AppenderDestroy

func AppenderDestroy(appender *Appender) State

AppenderDestroy wraps duckdb_appender_destroy.

func AppenderFlush

func AppenderFlush(appender Appender) State

func ArrowScan

func ArrowScan(conn Connection, table string, stream ArrowStream) State

func BindBlob

func BindBlob(preparedStmt PreparedStatement, index IdxT, v []byte) State

func BindBoolean

func BindBoolean(preparedStmt PreparedStatement, index IdxT, v bool) State

func BindDate

func BindDate(preparedStmt PreparedStatement, index IdxT, v Date) State

func BindDecimal

func BindDecimal(preparedStmt PreparedStatement, index IdxT, v Decimal) State

func BindDouble

func BindDouble(preparedStmt PreparedStatement, index IdxT, v float64) State

func BindFloat

func BindFloat(preparedStmt PreparedStatement, index IdxT, v float32) State

func BindHugeInt

func BindHugeInt(preparedStmt PreparedStatement, index IdxT, v HugeInt) State

func BindInt16

func BindInt16(preparedStmt PreparedStatement, index IdxT, v int16) State

func BindInt32

func BindInt32(preparedStmt PreparedStatement, index IdxT, v int32) State

func BindInt64

func BindInt64(preparedStmt PreparedStatement, index IdxT, v int64) State

func BindInt8

func BindInt8(preparedStmt PreparedStatement, index IdxT, v int8) State

func BindInterval

func BindInterval(preparedStmt PreparedStatement, index IdxT, v Interval) State

func BindNull

func BindNull(preparedStmt PreparedStatement, index IdxT) State

func BindParameterIndex

func BindParameterIndex(preparedStmt PreparedStatement, outIndex *IdxT, name string) State

func BindTime

func BindTime(preparedStmt PreparedStatement, index IdxT, v Time) State

func BindTimestamp

func BindTimestamp(preparedStmt PreparedStatement, index IdxT, v Timestamp) State

func BindTimestampTZ

func BindTimestampTZ(preparedStmt PreparedStatement, index IdxT, v Timestamp) State

func BindUHugeInt

func BindUHugeInt(preparedStmt PreparedStatement, index IdxT, v UHugeInt) State

func BindUInt16

func BindUInt16(preparedStmt PreparedStatement, index IdxT, v uint16) State

func BindUInt32

func BindUInt32(preparedStmt PreparedStatement, index IdxT, v uint32) State

func BindUInt64

func BindUInt64(preparedStmt PreparedStatement, index IdxT, v uint64) State

func BindUInt8

func BindUInt8(preparedStmt PreparedStatement, index IdxT, v uint8) State

func BindValue

func BindValue(preparedStmt PreparedStatement, index IdxT, v Value) State

func BindVarchar

func BindVarchar(preparedStmt PreparedStatement, index IdxT, v string) State

func BindVarcharLength

func BindVarcharLength(preparedStmt PreparedStatement, index IdxT, v string, length IdxT) State

func ClearBindings

func ClearBindings(preparedStmt PreparedStatement) State

func ColumnHasDefault

func ColumnHasDefault(desc TableDescription, index IdxT, outBool *bool) State

func Connect

func Connect(db Database, outConn *Connection) State

Connect wraps duckdb_connect. outConn must be disconnected with Disconnect.

func CreateConfig

func CreateConfig(outConfig *Config) State

CreateConfig wraps duckdb_create_config. outConfig must be destroyed with DestroyConfig.

func ExecutePending

func ExecutePending(res PendingResult, outRes *Result) State

ExecutePending wraps duckdb_execute_pending. outRes must be destroyed with DestroyResult.

func ExecutePrepared

func ExecutePrepared(preparedStmt PreparedStatement, outRes *Result) State

ExecutePrepared wraps duckdb_execute_prepared. outRes must be destroyed with DestroyResult.

func ExecutePreparedArrow

func ExecutePreparedArrow(preparedStmt PreparedStatement, outArrow *Arrow) State

ExecutePreparedArrow wraps duckdb_execute_prepared_arrow. outArrow must be destroyed with DestroyArrow.

func GetConfigFlag

func GetConfigFlag(index uint64, outName *string, outDescription *string) State

func GetOrCreateFromCache

func GetOrCreateFromCache(cache InstanceCache, path string, outDb *Database, config Config, errMsg *string) State

GetOrCreateFromCache wraps duckdb_get_or_create_from_cache. outDb must be closed with Close.

func ListVectorReserve

func ListVectorReserve(vec Vector, capacity IdxT) State

func ListVectorSetSize

func ListVectorSetSize(vec Vector, size IdxT) State

func Open

func Open(path string, outDb *Database) State

Open wraps duckdb_open. outDb must be closed with Close.

func OpenExt

func OpenExt(path string, outDb *Database, config Config, errMsg *string) State

OpenExt wraps duckdb_open_ext. outDb must be closed with Close.

func PendingPrepared

func PendingPrepared(preparedStmt PreparedStatement, outPendingRes *PendingResult) State

PendingPrepared wraps duckdb_pending_prepared. outPendingRes must be destroyed with DestroyPending.

func Prepare

func Prepare(conn Connection, query string, outPreparedStmt *PreparedStatement) State

Prepare wraps duckdb_prepare. outPreparedStmt must be destroyed with DestroyPrepare.

func PrepareExtractedStatement

func PrepareExtractedStatement(conn Connection, extractedStmts ExtractedStatements, index IdxT, outPreparedStmt *PreparedStatement) State

PrepareExtractedStatement wraps duckdb_prepare_extracted_statement. outPreparedStmt must be destroyed with DestroyPrepare.

func Query

func Query(conn Connection, query string, outRes *Result) State

Query wraps duckdb_query. outRes must be destroyed with DestroyResult.

func QueryArrowArray

func QueryArrowArray(arrow Arrow, outArray *ArrowArray) State

func QueryArrowSchema

func QueryArrowSchema(arrow Arrow, outSchema *ArrowSchema) State

func RegisterLogicalType

func RegisterLogicalType(conn Connection, logicalType LogicalType, info CreateTypeInfo) State

func RegisterScalarFunction

func RegisterScalarFunction(conn Connection, f ScalarFunction) State

func RegisterScalarFunctionSet

func RegisterScalarFunctionSet(conn Connection, f ScalarFunctionSet) State

func RegisterTableFunction

func RegisterTableFunction(conn Connection, f TableFunction) State

func SetConfig

func SetConfig(config Config, name string, option string) State

func TableDescriptionCreate

func TableDescriptionCreate(conn Connection, schema string, table string, outDesc *TableDescription) State

TableDescriptionCreate wraps duckdb_table_description_create. outDesc must be destroyed with TableDescriptionDestroy.

func TableDescriptionCreateExt

func TableDescriptionCreateExt(conn Connection, catalog string, schema string, table string, outDesc *TableDescription) State

TableDescriptionCreateExt wraps duckdb_table_description_create_ext. outDesc must be destroyed with TableDescriptionDestroy.

type StatementType

type StatementType = C.duckdb_statement_type

StatementType wraps duckdb_statement_type.

const (
	StatementTypeInvalid     StatementType = C.DUCKDB_STATEMENT_TYPE_INVALID
	StatementTypeSelect      StatementType = C.DUCKDB_STATEMENT_TYPE_SELECT
	StatementTypeInsert      StatementType = C.DUCKDB_STATEMENT_TYPE_INSERT
	StatementTypeUpdate      StatementType = C.DUCKDB_STATEMENT_TYPE_UPDATE
	StatementTypeExplain     StatementType = C.DUCKDB_STATEMENT_TYPE_EXPLAIN
	StatementTypeDelete      StatementType = C.DUCKDB_STATEMENT_TYPE_DELETE
	StatementTypePrepare     StatementType = C.DUCKDB_STATEMENT_TYPE_PREPARE
	StatementTypeCreate      StatementType = C.DUCKDB_STATEMENT_TYPE_CREATE
	StatementTypeExecute     StatementType = C.DUCKDB_STATEMENT_TYPE_EXECUTE
	StatementTypeAlter       StatementType = C.DUCKDB_STATEMENT_TYPE_ALTER
	StatementTypeTransaction StatementType = C.DUCKDB_STATEMENT_TYPE_TRANSACTION
	StatementTypeCopy        StatementType = C.DUCKDB_STATEMENT_TYPE_COPY
	StatementTypeAnalyze     StatementType = C.DUCKDB_STATEMENT_TYPE_ANALYZE
	StatementTypeVariableSet StatementType = C.DUCKDB_STATEMENT_TYPE_VARIABLE_SET
	StatementTypeCreateFunc  StatementType = C.DUCKDB_STATEMENT_TYPE_CREATE_FUNC
	StatementTypeDrop        StatementType = C.DUCKDB_STATEMENT_TYPE_DROP
	StatementTypeExport      StatementType = C.DUCKDB_STATEMENT_TYPE_EXPORT
	StatementTypePragma      StatementType = C.DUCKDB_STATEMENT_TYPE_PRAGMA
	StatementTypeVacuum      StatementType = C.DUCKDB_STATEMENT_TYPE_VACUUM
	StatementTypeCall        StatementType = C.DUCKDB_STATEMENT_TYPE_CALL
	StatementTypeSet         StatementType = C.DUCKDB_STATEMENT_TYPE_SET
	StatementTypeLoad        StatementType = C.DUCKDB_STATEMENT_TYPE_LOAD
	StatementTypeRelation    StatementType = C.DUCKDB_STATEMENT_TYPE_RELATION
	StatementTypeExtension   StatementType = C.DUCKDB_STATEMENT_TYPE_EXTENSION
	StatementTypeLogicalPlan StatementType = C.DUCKDB_STATEMENT_TYPE_LOGICAL_PLAN
	StatementTypeAttach      StatementType = C.DUCKDB_STATEMENT_TYPE_ATTACH
	StatementTypeDetach      StatementType = C.DUCKDB_STATEMENT_TYPE_DETACH
	StatementTypeMulti       StatementType = C.DUCKDB_STATEMENT_TYPE_MULTI
)

func PreparedStatementType

func PreparedStatementType(preparedStmt PreparedStatement) StatementType

func ResultStatementType

func ResultStatementType(res Result) StatementType

type StringT

type StringT = C.duckdb_string_t

StringT does not export New and Members. Use the respective StringT functions to access / write to this type.

type TableDescription

type TableDescription struct {
	Ptr unsafe.Pointer
}

TableDescription wraps *duckdb_table_description.

type TableFunction

type TableFunction struct {
	Ptr unsafe.Pointer
}

TableFunction wraps *duckdb_table_function.

func CreateTableFunction

func CreateTableFunction() TableFunction

CreateTableFunction wraps duckdb_create_table_function. The return value must be destroyed with DestroyTableFunction.

type Time

type Time = C.duckdb_time

func GetTime

func GetTime(v Value) Time

func NewTime

func NewTime(micros int64) Time

NewTime sets the members of a duckdb_time.

func ToTime

func ToTime(ti TimeStruct) Time

type TimeStruct

type TimeStruct = C.duckdb_time_struct

func FromTime

func FromTime(ti Time) TimeStruct

func NewTimeStruct

func NewTimeStruct(hour int8, min int8, sec int8, micros int32) TimeStruct

NewTimeStruct sets the members of a duckdb_time_struct.

func TimeTZStructMembers

func TimeTZStructMembers(ti *TimeTZStruct) (TimeStruct, int32)

TimeTZStructMembers returns the time and offset of a duckdb_time_tz_struct.

type TimeTZ

type TimeTZ = C.duckdb_time_tz

func CreateTimeTZ

func CreateTimeTZ(micros int64, offset int32) TimeTZ

func GetTimeTZ

func GetTimeTZ(v Value) TimeTZ

func NewTimeTZ

func NewTimeTZ(bits uint64) TimeTZ

NewTimeTZ sets the members of a duckdb_time_tz.

type TimeTZStruct

type TimeTZStruct = C.duckdb_time_tz_struct

func FromTimeTZ

func FromTimeTZ(ti TimeTZ) TimeTZStruct

func NewTimeTZStruct

func NewTimeTZStruct(ti TimeStruct, offset int32) TimeTZStruct

NewTimeTZStruct sets the members of a duckdb_time_tz_struct.

type Timestamp

type Timestamp = C.duckdb_timestamp

func GetTimestamp

func GetTimestamp(v Value) Timestamp

func GetTimestampTZ

func GetTimestampTZ(v Value) Timestamp

func NewTimestamp

func NewTimestamp(micros int64) Timestamp

NewTimestamp sets the members of a duckdb_timestamp.

func ToTimestamp

func ToTimestamp(ts TimestampStruct) Timestamp

type TimestampMS

type TimestampMS = C.duckdb_timestamp_ms

func GetTimestampMS

func GetTimestampMS(v Value) TimestampMS

func NewTimestampMS

func NewTimestampMS(millis int64) TimestampMS

NewTimestampMS sets the members of a duckdb_timestamp_ms.

type TimestampNS

type TimestampNS = C.duckdb_timestamp_ns

func GetTimestampNS

func GetTimestampNS(v Value) TimestampNS

func NewTimestampNS

func NewTimestampNS(nanos int64) TimestampNS

NewTimestampNS sets the members of a duckdb_timestamp_ns.

type TimestampS

type TimestampS = C.duckdb_timestamp_s

func GetTimestampS

func GetTimestampS(v Value) TimestampS

func NewTimestampS

func NewTimestampS(seconds int64) TimestampS

NewTimestampS sets the members of a duckdb_timestamp_s.

type TimestampStruct

type TimestampStruct = C.duckdb_timestamp_struct

func FromTimestamp

func FromTimestamp(ts Timestamp) TimestampStruct

func NewTimestampStruct

func NewTimestampStruct(date DateStruct, ti TimeStruct) TimestampStruct

NewTimestampStruct sets the members of a duckdb_timestamp_struct.

type Type

type Type = C.duckdb_type

Type wraps duckdb_type.

const (
	TypeInvalid     Type = C.DUCKDB_TYPE_INVALID
	TypeBoolean     Type = C.DUCKDB_TYPE_BOOLEAN
	TypeTinyInt     Type = C.DUCKDB_TYPE_TINYINT
	TypeSmallInt    Type = C.DUCKDB_TYPE_SMALLINT
	TypeInteger     Type = C.DUCKDB_TYPE_INTEGER
	TypeBigInt      Type = C.DUCKDB_TYPE_BIGINT
	TypeUTinyInt    Type = C.DUCKDB_TYPE_UTINYINT
	TypeUSmallInt   Type = C.DUCKDB_TYPE_USMALLINT
	TypeUInteger    Type = C.DUCKDB_TYPE_UINTEGER
	TypeUBigInt     Type = C.DUCKDB_TYPE_UBIGINT
	TypeFloat       Type = C.DUCKDB_TYPE_FLOAT
	TypeDouble      Type = C.DUCKDB_TYPE_DOUBLE
	TypeTimestamp   Type = C.DUCKDB_TYPE_TIMESTAMP
	TypeDate        Type = C.DUCKDB_TYPE_DATE
	TypeTime        Type = C.DUCKDB_TYPE_TIME
	TypeInterval    Type = C.DUCKDB_TYPE_INTERVAL
	TypeHugeInt     Type = C.DUCKDB_TYPE_HUGEINT
	TypeUHugeInt    Type = C.DUCKDB_TYPE_UHUGEINT
	TypeVarchar     Type = C.DUCKDB_TYPE_VARCHAR
	TypeBlob        Type = C.DUCKDB_TYPE_BLOB
	TypeDecimal     Type = C.DUCKDB_TYPE_DECIMAL
	TypeTimestampS  Type = C.DUCKDB_TYPE_TIMESTAMP_S
	TypeTimestampMS Type = C.DUCKDB_TYPE_TIMESTAMP_MS
	TypeTimestampNS Type = C.DUCKDB_TYPE_TIMESTAMP_NS
	TypeEnum        Type = C.DUCKDB_TYPE_ENUM
	TypeList        Type = C.DUCKDB_TYPE_LIST
	TypeStruct      Type = C.DUCKDB_TYPE_STRUCT
	TypeMap         Type = C.DUCKDB_TYPE_MAP
	TypeArray       Type = C.DUCKDB_TYPE_ARRAY
	TypeUUID        Type = C.DUCKDB_TYPE_UUID
	TypeUnion       Type = C.DUCKDB_TYPE_UNION
	TypeBit         Type = C.DUCKDB_TYPE_BIT
	TypeTimeTZ      Type = C.DUCKDB_TYPE_TIME_TZ
	TypeTimestampTZ Type = C.DUCKDB_TYPE_TIMESTAMP_TZ
	TypeAny         Type = C.DUCKDB_TYPE_ANY
	TypeVarInt      Type = C.DUCKDB_TYPE_VARINT
	TypeSQLNull     Type = C.DUCKDB_TYPE_SQLNULL
)

func ColumnType

func ColumnType(res *Result, col IdxT) Type

func DecimalInternalType

func DecimalInternalType(logicalType LogicalType) Type

func EnumInternalType

func EnumInternalType(logicalType LogicalType) Type

func GetTypeId

func GetTypeId(logicalType LogicalType) Type

func ParamType

func ParamType(preparedStmt PreparedStatement, index IdxT) Type

type UHugeInt

type UHugeInt = C.duckdb_uhugeint

func DoubleToUHugeInt

func DoubleToUHugeInt(d float64) UHugeInt

func GetUHugeInt

func GetUHugeInt(v Value) UHugeInt

func GetUUID

func GetUUID(v Value) UHugeInt

func NewUHugeInt

func NewUHugeInt(lower uint64, upper uint64) UHugeInt

NewUHugeInt sets the members of a duckdb_uhugeint.

type Value

type Value struct {
	Ptr unsafe.Pointer
}

Value wraps *duckdb_value.

func BindGetNamedParameter

func BindGetNamedParameter(info BindInfo, name string) Value

BindGetNamedParameter wraps duckdb_bind_get_named_parameter. The return value must be destroyed with DestroyValue.

func BindGetParameter

func BindGetParameter(info BindInfo, index IdxT) Value

BindGetParameter wraps duckdb_bind_get_parameter. The return value must be destroyed with DestroyValue.

func CreateArrayValue

func CreateArrayValue(logicalType LogicalType, values []Value) Value

CreateArrayValue wraps duckdb_create_array_value. The return value must be destroyed with DestroyValue.

func CreateBit

func CreateBit(val Bit) Value

CreateBit wraps duckdb_create_bit. The return value must be destroyed with DestroyValue.

func CreateBlob

func CreateBlob(val []byte) Value

CreateBlob wraps duckdb_create_blob. The return value must be destroyed with DestroyValue.

func CreateBool

func CreateBool(val bool) Value

CreateBool wraps duckdb_create_bool. The return value must be destroyed with DestroyValue.

func CreateDate

func CreateDate(val Date) Value

CreateDate wraps duckdb_create_date. The return value must be destroyed with DestroyValue.

func CreateDecimal

func CreateDecimal(val Decimal) Value

CreateDecimal wraps duckdb_create_decimal. The return value must be destroyed with DestroyValue.

func CreateDouble

func CreateDouble(val float64) Value

CreateDouble wraps duckdb_create_double. The return value must be destroyed with DestroyValue.

func CreateEnumValue

func CreateEnumValue(logicalType LogicalType, val uint64) Value

CreateEnumValue wraps duckdb_create_enum_value. The return value must be destroyed with DestroyValue.

func CreateFloat

func CreateFloat(val float32) Value

CreateFloat wraps duckdb_create_float. The return value must be destroyed with DestroyValue.

func CreateHugeInt

func CreateHugeInt(val HugeInt) Value

CreateHugeInt wraps duckdb_create_hugeint. The return value must be destroyed with DestroyValue.

func CreateInt16

func CreateInt16(val int16) Value

CreateInt16 wraps duckdb_create_int16. The return value must be destroyed with DestroyValue.

func CreateInt32

func CreateInt32(val int32) Value

CreateInt32 wraps duckdb_create_int32. The return value must be destroyed with DestroyValue.

func CreateInt64

func CreateInt64(val int64) Value

CreateInt64 wraps duckdb_create_int64. The return value must be destroyed with DestroyValue.

func CreateInt8

func CreateInt8(val int8) Value

CreateInt8 wraps duckdb_create_int8. The return value must be destroyed with DestroyValue.

func CreateInterval

func CreateInterval(val Interval) Value

CreateInterval wraps duckdb_create_interval. The return value must be destroyed with DestroyValue.

func CreateListValue

func CreateListValue(logicalType LogicalType, values []Value) Value

CreateListValue wraps duckdb_create_list_value. The return value must be destroyed with DestroyValue.

func CreateMapValue

func CreateMapValue(logicalType LogicalType, keys []Value, values []Value) Value

CreateMapValue wraps duckdb_create_map_value. The return value must be destroyed with DestroyValue.

func CreateNullValue

func CreateNullValue() Value

CreateNullValue wraps duckdb_create_null_value. The return value must be destroyed with DestroyValue.

func CreateStructValue

func CreateStructValue(logicalType LogicalType, values []Value) Value

CreateStructValue wraps duckdb_create_struct_value. The return value must be destroyed with DestroyValue.

func CreateTime

func CreateTime(val Time) Value

CreateTime wraps duckdb_create_time. The return value must be destroyed with DestroyValue.

func CreateTimeTZValue

func CreateTimeTZValue(timeTZ TimeTZ) Value

CreateTimeTZValue wraps duckdb_create_time_tz_value. The return value must be destroyed with DestroyValue.

func CreateTimestamp

func CreateTimestamp(val Timestamp) Value

CreateTimestamp wraps duckdb_create_timestamp. The return value must be destroyed with DestroyValue.

func CreateTimestampMS

func CreateTimestampMS(val TimestampMS) Value

CreateTimestampMS wraps duckdb_create_timestamp_ms. The return value must be destroyed with DestroyValue.

func CreateTimestampNS

func CreateTimestampNS(val TimestampNS) Value

CreateTimestampNS wraps duckdb_create_timestamp_ns. The return value must be destroyed with DestroyValue.

func CreateTimestampS

func CreateTimestampS(val TimestampS) Value

CreateTimestampS wraps duckdb_create_timestamp_s. The return value must be destroyed with DestroyValue.

func CreateTimestampTZ

func CreateTimestampTZ(val Timestamp) Value

CreateTimestampTZ wraps duckdb_create_timestamp_tz. The return value must be destroyed with DestroyValue.

func CreateUHugeInt

func CreateUHugeInt(val UHugeInt) Value

CreateUHugeInt wraps duckdb_create_uhugeint. The return value must be destroyed with DestroyValue.

func CreateUInt16

func CreateUInt16(val uint16) Value

CreateUInt16 wraps duckdb_create_uint16. The return value must be destroyed with DestroyValue.

func CreateUInt32

func CreateUInt32(val uint32) Value

CreateUInt32 wraps duckdb_create_uint32. The return value must be destroyed with DestroyValue.

func CreateUInt64

func CreateUInt64(val uint64) Value

CreateUInt64 wraps duckdb_create_uint64. The return value must be destroyed with DestroyValue.

func CreateUInt8

func CreateUInt8(val uint8) Value

CreateUInt8 wraps duckdb_create_uint8. The return value must be destroyed with DestroyValue.

func CreateUUID

func CreateUUID(val UHugeInt) Value

CreateUUID wraps duckdb_create_uuid. The return value must be destroyed with DestroyValue.

func CreateUnionValue

func CreateUnionValue(logicalType LogicalType, tag IdxT, value Value) Value

CreateUnionValue wraps duckdb_create_union_value. The return value must be destroyed with DestroyValue.

func CreateVarchar

func CreateVarchar(str string) Value

CreateVarchar wraps duckdb_create_varchar. The return value must be destroyed with DestroyValue.

func CreateVarcharLength

func CreateVarcharLength(str string, length IdxT) Value

CreateVarcharLength wraps duckdb_create_varchar_length. The return value must be destroyed with DestroyValue.

func CreateVarint

func CreateVarint(val VarInt) Value

CreateVarint wraps duckdb_create_varint. The return value must be destroyed with DestroyValue.

func GetListChild

func GetListChild(val Value, index IdxT) Value

GetListChild wraps duckdb_get_list_child. The return value must be destroyed with DestroyValue.

func GetMapKey

func GetMapKey(v Value, index IdxT) Value

GetMapKey wraps duckdb_get_map_key. The return value must be destroyed with DestroyValue.

func GetMapValue

func GetMapValue(v Value, index IdxT) Value

GetMapValue wraps duckdb_get_map_value. The return value must be destroyed with DestroyValue.

func GetStructChild

func GetStructChild(val Value, index IdxT) Value

GetStructChild wraps duckdb_get_struct_child. The return value must be destroyed with DestroyValue.

func GetTableNames

func GetTableNames(conn Connection, query string, qualified bool) Value

GetTableNames wraps duckdb_get_table_names. The return value must be destroyed with DestroyValue.

func ProfilingInfoGetMetrics

func ProfilingInfoGetMetrics(info ProfilingInfo) Value

ProfilingInfoGetMetrics wraps duckdb_profiling_info_get_metrics. The return value must be destroyed with DestroyValue.

func ProfilingInfoGetValue

func ProfilingInfoGetValue(info ProfilingInfo, key string) Value

ProfilingInfoGetValue wraps duckdb_profiling_info_get_value. The return value must be destroyed with DestroyValue.

type VarInt

type VarInt = C.duckdb_varint

VarInt does not export New and Members. Use the respective VarInt functions to access / write to this type. This type must be destroyed with DestroyVarInt.

func GetVarInt

func GetVarInt(v Value) VarInt

GetVarInt wraps duckdb_get_varint. The return value must be destroyed with DestroyVarInt.

type Vector

type Vector struct {
	Ptr unsafe.Pointer
}

Vector wraps *duckdb_vector.

func ArrayVectorGetChild

func ArrayVectorGetChild(vec Vector) Vector

func CreateVector

func CreateVector(logicalType LogicalType, capacity IdxT) Vector

CreateVector wraps duckdb_create_vector. The return value must be destroyed with DestroyVector.

func DataChunkGetVector

func DataChunkGetVector(chunk DataChunk, index IdxT) Vector

func ListVectorGetChild

func ListVectorGetChild(vec Vector) Vector

func StructVectorGetChild

func StructVectorGetChild(vec Vector, index IdxT) Vector

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL