Crate libduckdb_sys[][src]

Structs

! Days are stored as days since 1970-01-01 ! Use the duckdb_from_date/duckdb_to_date function to extract individual information

! Hugeints are composed in a (lower, upper) component ! The value of the hugeint is upper * 2^64 + lower ! For easy usage, the functions duckdb_hugeint_to_double/duckdb_double_to_hugeint are recommended

! Time is stored as microseconds since 00:00:00 ! Use the duckdb_from_time/duckdb_to_time function to extract individual information

! Timestamps are stored as microseconds since 1970-01-01 ! Use the duckdb_from_timestamp/duckdb_to_timestamp function to extract individual information

Enums

Error Codes

Constants

Statics

Functions

Append a blob value to the appender.

Append a bool value to the appender.

Append a duckdb_date value to the appender.

Append a double value to the appender.

Append a float value to the appender.

Append a duckdb_hugeint value to the appender.

Append an int8_t value to the appender.

Append an int16_t value to the appender.

Append an int32_t value to the appender.

Append an int64_t value to the appender.

Append a duckdb_interval value to the appender.

Append a NULL value to the appender (of any type).

Append a duckdb_time value to the appender.

Append a duckdb_timestamp value to the appender.

Append a uint8_t value to the appender.

Append a uint16_t value to the appender.

Append a uint32_t value to the appender.

Append a uint64_t value to the appender.

Append a varchar value to the appender.

Append a varchar value to the appender.

A nop function, provided for backwards compatibility reasons. Does nothing. Only duckdb_appender_end_row is required.

Close the appender, flushing all intermediate state in the appender to the table and closing it for further appends.

Creates an appender object.

Close the appender and destroy it. Flushing all intermediate state in the appender to the table, and de-allocating all memory associated with the appender.

Finish the current row of appends. After end_row is called, the next row can be appended.

Returns the error message associated with the given appender. If the appender has no error message, this returns nullptr instead.

Flush the appender to the table, forcing the cache of the appender to be cleared and the data to be appended to the base table.

Returns the number of columns present in a the arrow result object.

Returns the number of rows present in a the arrow result object.

Returns the number of rows changed by the query stored in the arrow result. This is relevant only for INSERT/UPDATE/DELETE queries. For other queries the rows_changed will be 0.

Binds a blob value to the prepared statement at the specified index.

Binds a bool value to the prepared statement at the specified index.

Binds a duckdb_date value to the prepared statement at the specified index.

Binds an double value to the prepared statement at the specified index.

Binds an float value to the prepared statement at the specified index.

Binds an duckdb_hugeint value to the prepared statement at the specified index.

Binds an int8_t value to the prepared statement at the specified index.

Binds an int16_t value to the prepared statement at the specified index.

Binds an int32_t value to the prepared statement at the specified index.

Binds an int64_t value to the prepared statement at the specified index.

Binds a duckdb_interval value to the prepared statement at the specified index.

Binds a NULL value to the prepared statement at the specified index.

Binds a duckdb_time value to the prepared statement at the specified index.

Binds a duckdb_timestamp value to the prepared statement at the specified index.

Binds an uint8_t value to the prepared statement at the specified index.

Binds an uint16_t value to the prepared statement at the specified index.

Binds an uint32_t value to the prepared statement at the specified index.

Binds an uint64_t value to the prepared statement at the specified index.

Binds a null-terminated varchar value to the prepared statement at the specified index.

Binds a varchar value to the prepared statement at the specified index.

Closes the specified database and de-allocates all memory allocated for that database. This should be called after you are done with any database allocated through duckdb_open. Note that failing to call duckdb_close (in case of e.g. a program crash) will not cause data corruption. Still it is recommended to always correctly close a database object after you are done with it.

Returns the number of columns present in a the result object.

Returns the data of a specific column of a result in columnar format. This is the fastest way of accessing data in a query result, as no conversion or type checking must be performed (outside of the original switch). If performance is a concern, it is recommended to use this API over the duckdb_value functions.

Returns the column name of the specified column. The result should not need be freed; the column names will automatically be destroyed when the result is destroyed.

Returns the column type of the specified column.

This returns the total amount of configuration options available for usage with duckdb_get_config_flag.

Opens a connection to a database. Connections are required to query the database, and store transactional state associated with the connection.

Initializes an empty configuration object that can be used to provide start-up options for the DuckDB instance through duckdb_open_ext.

Closes the result and de-allocates all memory allocated for the arrow result.

Destroys the specified configuration option and de-allocates all memory allocated for the object.

Closes the prepared statement and de-allocates all memory allocated for that connection.

Closes the result and de-allocates all memory allocated for that connection.

Closes the specified connection and de-allocates all memory allocated for that connection.

Converts a double value to a duckdb_hugeint object.

Executes the prepared statement with the given bound parameters, and returns a materialized query result.

Executes the prepared statement with the given bound parameters, and returns an arrow query result.

Free a value returned from duckdb_malloc, duckdb_value_varchar or duckdb_value_blob.

Decompose a duckdb_date object into year, month and date (stored as duckdb_date_struct).

Decompose a duckdb_time object into hour, minute, second and microsecond (stored as duckdb_time_struct).

Decompose a duckdb_timestamp object into a duckdb_timestamp_struct.

Obtains a human-readable name and description of a specific configuration option. This can be used to e.g. display configuration options. This will succeed unless index is out of range (i.e. >= duckdb_config_count).

Converts a duckdb_hugeint object (as obtained from a DUCKDB_TYPE_HUGEINT column) into a double.

Allocate size bytes of memory using the duckdb internal malloc function. Any memory allocated in this manner should be freed using duckdb_free.

Returns the number of parameters that can be provided to the given prepared statement.

Returns the nullmask of a specific column of a result in columnar format. The nullmask indicates for every row whether or not the corresponding row is NULL. If a row is NULL, the values present in the array provided by duckdb_column_data are undefined.

Creates a new database or opens an existing database file stored at the the given path. If no path is given a new in-memory database is created instead.

Extended version of duckdb_open. Creates a new database or opens an existing database file stored at the the given path.

Returns the parameter type for the parameter at the given index.

Create a prepared statement object from a query.

Returns the error message associated with the given prepared statement. If the prepared statement has no error message, this returns nullptr instead.

Executes a SQL query within a connection and stores the full (materialized) result in the out_result pointer. If the query fails to execute, DuckDBError is returned and the error message can be retrieved by calling duckdb_result_error.

Executes a SQL query within a connection and stores the full (materialized) result in an arrow structure. If the query fails to execute, DuckDBError is returned and the error message can be retrieved by calling duckdb_query_arrow_error.

Fetch an internal arrow array from the arrow result.

Returns the error message contained within the result. The error is only set if duckdb_query_arrow returns DuckDBError.

Fetch the internal arrow schema from the arrow result.

Returns the error message contained within the result. The error is only set if duckdb_query returns DuckDBError.

Returns the number of rows present in a the result object.

Returns the number of rows changed by the query stored in the result. This is relevant only for INSERT/UPDATE/DELETE queries. For other queries the rows_changed will be 0.

Sets the specified option for the specified configuration. The configuration option is indicated by name. To obtain a list of config options, see duckdb_get_config_flag.

Re-compose a duckdb_date from year, month and date (duckdb_date_struct).

Re-compose a duckdb_time from hour, minute, second and microsecond (duckdb_time_struct).

Re-compose a duckdb_timestamp from a duckdb_timestamp_struct.

returns: The duckdb_blob value at the specified location. Returns a blob with blob.data set to nullptr if the value cannot be converted. The resulting “blob.data” must be freed with duckdb_free.

returns: The boolean value at the specified location, or false if the value cannot be converted.

returns: The duckdb_date value at the specified location, or 0 if the value cannot be converted.

returns: The double value at the specified location, or 0 if the value cannot be converted.

returns: The float value at the specified location, or 0 if the value cannot be converted.

returns: The duckdb_hugeint value at the specified location, or 0 if the value cannot be converted.

returns: The int8_t value at the specified location, or 0 if the value cannot be converted.

returns: The int16_t value at the specified location, or 0 if the value cannot be converted.

returns: The int32_t value at the specified location, or 0 if the value cannot be converted.

returns: The int64_t value at the specified location, or 0 if the value cannot be converted.

returns: The duckdb_interval value at the specified location, or 0 if the value cannot be converted.

returns: Returns true if the value at the specified index is NULL, and false otherwise.

returns: The duckdb_time value at the specified location, or 0 if the value cannot be converted.

returns: The duckdb_timestamp value at the specified location, or 0 if the value cannot be converted.

returns: The uint8_t value at the specified location, or 0 if the value cannot be converted.

returns: The uint16_t value at the specified location, or 0 if the value cannot be converted.

returns: The uint32_t value at the specified location, or 0 if the value cannot be converted.

returns: The uint64_t value at the specified location, or 0 if the value cannot be converted.

returns: The char* value at the specified location, or nullptr if the value cannot be converted. The result must be freed with duckdb_free.

returns: The char* value at the specified location. ONLY works on VARCHAR columns and does not auto-cast. If the column is NOT a VARCHAR column this function will return NULL.

Type Definitions

Unions