packages feed

duckdb-ffi 1.4.1.1 → 1.4.1.2

raw patch · 37 files changed

+920/−827 lines, 37 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Database.DuckDB.FFI: c_duckdb_appender_error :: DuckDBAppender -> IO CString
- Database.DuckDB.FFI: c_duckdb_arrow_array_scan :: DuckDBConnection -> CString -> DuckDBArrowSchema -> DuckDBArrowArray -> Ptr DuckDBArrowStream -> IO DuckDBState
- Database.DuckDB.FFI: c_duckdb_arrow_column_count :: DuckDBArrow -> IO DuckDBIdx
- Database.DuckDB.FFI: c_duckdb_arrow_row_count :: DuckDBArrow -> IO DuckDBIdx
- Database.DuckDB.FFI: c_duckdb_arrow_rows_changed :: DuckDBArrow -> IO DuckDBIdx
- Database.DuckDB.FFI: c_duckdb_arrow_scan :: DuckDBConnection -> CString -> DuckDBArrowStream -> IO DuckDBState
- Database.DuckDB.FFI: c_duckdb_column_data :: Ptr DuckDBResult -> DuckDBIdx -> IO (Ptr ())
- Database.DuckDB.FFI: c_duckdb_destroy_arrow :: Ptr DuckDBArrow -> IO ()
- Database.DuckDB.FFI: c_duckdb_destroy_arrow_stream :: Ptr DuckDBArrowStream -> IO ()
- Database.DuckDB.FFI: c_duckdb_execute_prepared_arrow :: DuckDBPreparedStatement -> Ptr DuckDBArrow -> IO DuckDBState
- Database.DuckDB.FFI: c_duckdb_execute_prepared_streaming :: DuckDBPreparedStatement -> Ptr DuckDBResult -> IO DuckDBState
- Database.DuckDB.FFI: c_duckdb_nullmask_data :: Ptr DuckDBResult -> DuckDBIdx -> IO (Ptr CBool)
- Database.DuckDB.FFI: c_duckdb_pending_prepared_streaming :: DuckDBPreparedStatement -> Ptr DuckDBPendingResult -> IO DuckDBState
- Database.DuckDB.FFI: c_duckdb_prepared_arrow_schema :: DuckDBPreparedStatement -> Ptr DuckDBArrowSchema -> IO DuckDBState
- Database.DuckDB.FFI: c_duckdb_query_arrow :: DuckDBConnection -> CString -> Ptr DuckDBArrow -> IO DuckDBState
- Database.DuckDB.FFI: c_duckdb_query_arrow_array :: DuckDBArrow -> Ptr DuckDBArrowArray -> IO DuckDBState
- Database.DuckDB.FFI: c_duckdb_query_arrow_error :: DuckDBArrow -> IO CString
- Database.DuckDB.FFI: c_duckdb_query_arrow_schema :: DuckDBArrow -> Ptr DuckDBArrowSchema -> IO DuckDBState
- Database.DuckDB.FFI: c_duckdb_result_arrow_array :: Ptr DuckDBResult -> DuckDBDataChunk -> Ptr DuckDBArrowArray -> IO ()
- Database.DuckDB.FFI: c_duckdb_result_chunk_count :: Ptr DuckDBResult -> IO DuckDBIdx
- Database.DuckDB.FFI: c_duckdb_result_get_chunk :: Ptr DuckDBResult -> DuckDBIdx -> IO DuckDBDataChunk
- Database.DuckDB.FFI: c_duckdb_result_is_streaming :: Ptr DuckDBResult -> IO CBool
- Database.DuckDB.FFI: c_duckdb_row_count :: Ptr DuckDBResult -> IO DuckDBIdx
- Database.DuckDB.FFI: c_duckdb_stream_fetch_chunk :: Ptr DuckDBResult -> IO DuckDBDataChunk
- Database.DuckDB.FFI: c_duckdb_value_blob :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBBlob -> IO ()
- Database.DuckDB.FFI: c_duckdb_value_boolean :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CBool
- Database.DuckDB.FFI: c_duckdb_value_date :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO DuckDBDate
- Database.DuckDB.FFI: c_duckdb_value_decimal :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBDecimal -> IO ()
- Database.DuckDB.FFI: c_duckdb_value_double :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CDouble
- Database.DuckDB.FFI: c_duckdb_value_float :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CFloat
- Database.DuckDB.FFI: c_duckdb_value_hugeint :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBHugeInt -> IO ()
- Database.DuckDB.FFI: c_duckdb_value_int16 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int16
- Database.DuckDB.FFI: c_duckdb_value_int32 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int32
- Database.DuckDB.FFI: c_duckdb_value_int64 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int64
- Database.DuckDB.FFI: c_duckdb_value_int8 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int8
- Database.DuckDB.FFI: c_duckdb_value_interval :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBInterval -> IO ()
- Database.DuckDB.FFI: c_duckdb_value_is_null :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CBool
- Database.DuckDB.FFI: c_duckdb_value_string :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBString -> IO ()
- Database.DuckDB.FFI: c_duckdb_value_string_internal :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBString -> IO ()
- Database.DuckDB.FFI: c_duckdb_value_time :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO DuckDBTime
- Database.DuckDB.FFI: c_duckdb_value_timestamp :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO DuckDBTimestamp
- Database.DuckDB.FFI: c_duckdb_value_uhugeint :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBUHugeInt -> IO ()
- Database.DuckDB.FFI: c_duckdb_value_uint16 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word16
- Database.DuckDB.FFI: c_duckdb_value_uint32 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word32
- Database.DuckDB.FFI: c_duckdb_value_uint64 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word64
- Database.DuckDB.FFI: c_duckdb_value_uint8 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word8
- Database.DuckDB.FFI: c_duckdb_value_varchar :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CString
- Database.DuckDB.FFI: c_duckdb_value_varchar_internal :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CString
- Database.DuckDB.FFI: duckdbArrowArrayClear :: DuckDBArrowArray -> IO ()
- Database.DuckDB.FFI: duckdbArrowArrayInternal :: DuckDBArrowArray -> IO (Maybe ArrowArrayPtr)
- Database.DuckDB.FFI: duckdbArrowSchemaClear :: DuckDBArrowSchema -> IO ()
- Database.DuckDB.FFI: duckdbArrowSchemaInternal :: DuckDBArrowSchema -> IO (Maybe ArrowSchemaPtr)
- Database.DuckDB.FFI: duckdbArrowStreamClear :: DuckDBArrowStream -> IO ()
- Database.DuckDB.FFI: duckdbArrowStreamInternal :: DuckDBArrowStream -> IO (Maybe ArrowStreamPtr)
+ Database.DuckDB.FFI.Deprecated: c_duckdb_appender_error :: DuckDBAppender -> IO CString
+ Database.DuckDB.FFI.Deprecated: c_duckdb_arrow_array_scan :: DuckDBConnection -> CString -> DuckDBArrowSchema -> DuckDBArrowArray -> Ptr DuckDBArrowStream -> IO DuckDBState
+ Database.DuckDB.FFI.Deprecated: c_duckdb_arrow_column_count :: DuckDBArrow -> IO DuckDBIdx
+ Database.DuckDB.FFI.Deprecated: c_duckdb_arrow_row_count :: DuckDBArrow -> IO DuckDBIdx
+ Database.DuckDB.FFI.Deprecated: c_duckdb_arrow_rows_changed :: DuckDBArrow -> IO DuckDBIdx
+ Database.DuckDB.FFI.Deprecated: c_duckdb_arrow_scan :: DuckDBConnection -> CString -> DuckDBArrowStream -> IO DuckDBState
+ Database.DuckDB.FFI.Deprecated: c_duckdb_column_data :: Ptr DuckDBResult -> DuckDBIdx -> IO (Ptr ())
+ Database.DuckDB.FFI.Deprecated: c_duckdb_destroy_arrow :: Ptr DuckDBArrow -> IO ()
+ Database.DuckDB.FFI.Deprecated: c_duckdb_destroy_arrow_stream :: Ptr DuckDBArrowStream -> IO ()
+ Database.DuckDB.FFI.Deprecated: c_duckdb_execute_prepared_arrow :: DuckDBPreparedStatement -> Ptr DuckDBArrow -> IO DuckDBState
+ Database.DuckDB.FFI.Deprecated: c_duckdb_execute_prepared_streaming :: DuckDBPreparedStatement -> Ptr DuckDBResult -> IO DuckDBState
+ Database.DuckDB.FFI.Deprecated: c_duckdb_nullmask_data :: Ptr DuckDBResult -> DuckDBIdx -> IO (Ptr CBool)
+ Database.DuckDB.FFI.Deprecated: c_duckdb_pending_prepared_streaming :: DuckDBPreparedStatement -> Ptr DuckDBPendingResult -> IO DuckDBState
+ Database.DuckDB.FFI.Deprecated: c_duckdb_prepared_arrow_schema :: DuckDBPreparedStatement -> Ptr DuckDBArrowSchema -> IO DuckDBState
+ Database.DuckDB.FFI.Deprecated: c_duckdb_query_arrow :: DuckDBConnection -> CString -> Ptr DuckDBArrow -> IO DuckDBState
+ Database.DuckDB.FFI.Deprecated: c_duckdb_query_arrow_array :: DuckDBArrow -> Ptr DuckDBArrowArray -> IO DuckDBState
+ Database.DuckDB.FFI.Deprecated: c_duckdb_query_arrow_error :: DuckDBArrow -> IO CString
+ Database.DuckDB.FFI.Deprecated: c_duckdb_query_arrow_schema :: DuckDBArrow -> Ptr DuckDBArrowSchema -> IO DuckDBState
+ Database.DuckDB.FFI.Deprecated: c_duckdb_result_arrow_array :: Ptr DuckDBResult -> DuckDBDataChunk -> Ptr DuckDBArrowArray -> IO ()
+ Database.DuckDB.FFI.Deprecated: c_duckdb_result_chunk_count :: Ptr DuckDBResult -> IO DuckDBIdx
+ Database.DuckDB.FFI.Deprecated: c_duckdb_result_get_chunk :: Ptr DuckDBResult -> DuckDBIdx -> IO DuckDBDataChunk
+ Database.DuckDB.FFI.Deprecated: c_duckdb_result_is_streaming :: Ptr DuckDBResult -> IO CBool
+ Database.DuckDB.FFI.Deprecated: c_duckdb_row_count :: Ptr DuckDBResult -> IO DuckDBIdx
+ Database.DuckDB.FFI.Deprecated: c_duckdb_stream_fetch_chunk :: Ptr DuckDBResult -> IO DuckDBDataChunk
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_blob :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBBlob -> IO ()
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_boolean :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CBool
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_date :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO DuckDBDate
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_decimal :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBDecimal -> IO ()
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_double :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CDouble
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_float :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CFloat
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_hugeint :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBHugeInt -> IO ()
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_int16 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int16
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_int32 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int32
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_int64 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int64
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_int8 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int8
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_interval :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBInterval -> IO ()
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_is_null :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CBool
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_string :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBString -> IO ()
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_string_internal :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBString -> IO ()
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_time :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO DuckDBTime
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_timestamp :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO DuckDBTimestamp
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_uhugeint :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBUHugeInt -> IO ()
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_uint16 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word16
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_uint32 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word32
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_uint64 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word64
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_uint8 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word8
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_varchar :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CString
+ Database.DuckDB.FFI.Deprecated: c_duckdb_value_varchar_internal :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CString
+ Database.DuckDB.FFI.Deprecated: duckdbArrowArrayClear :: DuckDBArrowArray -> IO ()
+ Database.DuckDB.FFI.Deprecated: duckdbArrowArrayInternal :: DuckDBArrowArray -> IO (Maybe ArrowArrayPtr)
+ Database.DuckDB.FFI.Deprecated: duckdbArrowSchemaClear :: DuckDBArrowSchema -> IO ()
+ Database.DuckDB.FFI.Deprecated: duckdbArrowSchemaInternal :: DuckDBArrowSchema -> IO (Maybe ArrowSchemaPtr)
+ Database.DuckDB.FFI.Deprecated: duckdbArrowStreamClear :: DuckDBArrowStream -> IO ()
+ Database.DuckDB.FFI.Deprecated: duckdbArrowStreamInternal :: DuckDBArrowStream -> IO (Maybe ArrowStreamPtr)

Files

CHANGELOG.md view
@@ -1,4 +1,7 @@ # Changelog +## 0.1.4.2+- Move deprecated FFI functions to the Deprecated module.+ ## 0.1.4.1 - Initial release
duckdb-ffi.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.4 name:               duckdb-ffi-version:            1.4.1.1+version:            1.4.1.2 author:             Matthias Pall Gissurarson maintainer:         mpg@mpg.is category:           Database@@ -49,6 +49,7 @@     src   exposed-modules:     Database.DuckDB.FFI+    Database.DuckDB.FFI.Deprecated   other-modules:     Database.DuckDB.FFI.AggregateFunctions     Database.DuckDB.FFI.Appender@@ -57,6 +58,14 @@     Database.DuckDB.FFI.CastFunctions     Database.DuckDB.FFI.Configuration     Database.DuckDB.FFI.DataChunk+    Database.DuckDB.FFI.Deprecated.Appender+    Database.DuckDB.FFI.Deprecated.Arrow+    Database.DuckDB.FFI.Deprecated.ExecutePrepared+    Database.DuckDB.FFI.Deprecated.PendingResult+    Database.DuckDB.FFI.Deprecated.QueryExecution+    Database.DuckDB.FFI.Deprecated.ResultFunctions+    Database.DuckDB.FFI.Deprecated.SafeFetch+    Database.DuckDB.FFI.Deprecated.StreamingResult     Database.DuckDB.FFI.ErrorData     Database.DuckDB.FFI.ExecutePrepared     Database.DuckDB.FFI.Expression@@ -70,7 +79,6 @@     Database.DuckDB.FFI.QueryExecution     Database.DuckDB.FFI.ReplacementScans     Database.DuckDB.FFI.ResultFunctions-    Database.DuckDB.FFI.SafeFetch     Database.DuckDB.FFI.ScalarFunctions     Database.DuckDB.FFI.SelectionVector     Database.DuckDB.FFI.StreamingResult
src/Database/DuckDB/FFI.hs view
@@ -13,7 +13,6 @@     module Database.DuckDB.FFI.ErrorData,     module Database.DuckDB.FFI.QueryExecution,     module Database.DuckDB.FFI.ResultFunctions,-    module Database.DuckDB.FFI.SafeFetch,     module Database.DuckDB.FFI.Helpers,     module Database.DuckDB.FFI.PreparedStatements,     module Database.DuckDB.FFI.BindValues,@@ -60,7 +59,6 @@ import Database.DuckDB.FFI.QueryExecution import Database.DuckDB.FFI.ReplacementScans import Database.DuckDB.FFI.ResultFunctions-import Database.DuckDB.FFI.SafeFetch import Database.DuckDB.FFI.ScalarFunctions import Database.DuckDB.FFI.SelectionVector import Database.DuckDB.FFI.StreamingResult
src/Database/DuckDB/FFI/Appender.hs view
@@ -4,7 +4,6 @@     c_duckdb_appender_create_query,     c_duckdb_appender_column_count,     c_duckdb_appender_column_type,-    c_duckdb_appender_error,     c_duckdb_appender_error_data,     c_duckdb_appender_flush,     c_duckdb_appender_close,@@ -128,23 +127,6 @@ -} foreign import ccall "duckdb_appender_column_type"     c_duckdb_appender_column_type :: DuckDBAppender -> DuckDBIdx -> IO DuckDBLogicalType--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release. Use duckdb_appender_error_data instead.--Returns the error message associated with the appender. If the appender has no-error message, this returns @nullptr@ instead.--The error message should not be freed. It will be de-allocated when-@duckdb_appender_destroy@ is called.--Parameters:-* @appender@: The appender to get the error from.--Returns The error message, or @nullptr@ if there is none.--}-foreign import ccall "duckdb_appender_error"-    c_duckdb_appender_error :: DuckDBAppender -> IO CString  {- | Returns the error data associated with the appender. Must be destroyed with duckdb_destroy_error_data.
src/Database/DuckDB/FFI/Arrow.hs view
@@ -4,32 +4,11 @@     c_duckdb_schema_from_arrow,     c_duckdb_data_chunk_from_arrow,     c_duckdb_destroy_arrow_converted_schema,-    c_duckdb_query_arrow,-    c_duckdb_query_arrow_schema,-    c_duckdb_prepared_arrow_schema,-    c_duckdb_result_arrow_array,-    c_duckdb_query_arrow_array,-    c_duckdb_arrow_column_count,-    c_duckdb_arrow_row_count,-    c_duckdb_arrow_rows_changed,-    c_duckdb_query_arrow_error,-    c_duckdb_destroy_arrow,-    c_duckdb_destroy_arrow_stream,-    c_duckdb_execute_prepared_arrow,-    c_duckdb_arrow_scan,-    c_duckdb_arrow_array_scan,-    duckdbArrowSchemaInternal,-    duckdbArrowSchemaClear,-    duckdbArrowArrayInternal,-    duckdbArrowArrayClear,-    duckdbArrowStreamInternal,-    duckdbArrowStreamClear, ) where  import Database.DuckDB.FFI.Types import Foreign.C.String (CString)-import Foreign.C.Types (CInt (..))-import Foreign.Ptr (Ptr, castPtr, nullPtr)+import Foreign.Ptr (Ptr)  {- | Transforms a DuckDB Schema into an Arrow Schema @@ -99,297 +78,3 @@ -} foreign import ccall safe "duckdb_destroy_arrow_converted_schema"     c_duckdb_destroy_arrow_converted_schema :: Ptr DuckDBArrowConvertedSchema -> IO ()--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--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@.--Note that after running @duckdb_query_arrow@, @duckdb_destroy_arrow@ must be-called on the result object even if the query fails, otherwise the error-stored within the result will not be freed correctly.--Parameters:-* @connection@: The connection to perform the query in.-* @query@: The SQL query to run.-* @out_result@: The query result.--Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.--}-foreign import ccall "duckdb_query_arrow"-    c_duckdb_query_arrow :: DuckDBConnection -> CString -> Ptr DuckDBArrow -> IO DuckDBState--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Fetch the internal arrow schema from the arrow result. Remember to call-release on the respective ArrowSchema object.--Parameters:-* @result@: The result to fetch the schema from.-* @out_schema@: The output schema.--Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.--}-foreign import ccall safe "duckdb_query_arrow_schema"-    c_duckdb_query_arrow_schema :: DuckDBArrow -> Ptr DuckDBArrowSchema -> IO DuckDBState--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Fetch the internal arrow schema from the prepared statement. Remember to call-release on the respective ArrowSchema object.--Parameters:-* @prepared@: The prepared statement to fetch the schema from.-* @out_schema@: The output schema.--Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.--}-foreign import ccall safe "duckdb_prepared_arrow_schema"-    c_duckdb_prepared_arrow_schema :: DuckDBPreparedStatement -> Ptr DuckDBArrowSchema -> IO DuckDBState--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Convert a data chunk into an arrow struct array. Remember to call release on-the respective ArrowArray object.--Parameters:-* @result@: The result object the data chunk have been fetched from.-* @chunk@: The data chunk to convert.-* @out_array@: The output array.--These bindings call the wrapper symbol-@wrapped_duckdb_result_arrow_array@ but mirror the DuckDB C API semantics of-@duckdb_result_arrow_array@.--}-foreign import ccall safe "wrapped_duckdb_result_arrow_array"-    c_duckdb_result_arrow_array :: Ptr DuckDBResult -> DuckDBDataChunk -> Ptr DuckDBArrowArray -> IO ()--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Fetch an internal arrow struct array from the arrow result. Remember to call-release on the respective ArrowArray object.--This function can be called multiple time to get next chunks, which will free-the previous out_array. So consume the out_array before calling this function-again.--Parameters:-* @result@: The result to fetch the array from.-* @out_array@: The output array.--Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.--}-foreign import ccall "duckdb_query_arrow_array"-    c_duckdb_query_arrow_array :: DuckDBArrow -> Ptr DuckDBArrowArray -> IO DuckDBState--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns the number of columns present in the arrow result object.--Parameters:-* @result@: The result object.--Returns The number of columns present in the result object.--}-foreign import ccall safe "duckdb_arrow_column_count"-    c_duckdb_arrow_column_count :: DuckDBArrow -> IO DuckDBIdx--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns the number of rows present in the arrow result object.--Parameters:-* @result@: The result object.--Returns The number of rows present in the result object.--}-foreign import ccall safe "duckdb_arrow_row_count"-    c_duckdb_arrow_row_count :: DuckDBArrow -> IO DuckDBIdx--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--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.--Parameters:-* @result@: The result object.--Returns The number of rows changed.--}-foreign import ccall safe "duckdb_arrow_rows_changed"-    c_duckdb_arrow_rows_changed :: DuckDBArrow -> IO DuckDBIdx--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns the error message contained within the result. The error is only set-if @duckdb_query_arrow@ returns @DuckDBError@.--The error message should not be freed. It will be de-allocated when-@duckdb_destroy_arrow@ is called.--Parameters:-* @result@: The result object to fetch the error from.--Returns The error of the result.--}-foreign import ccall safe "duckdb_query_arrow_error"-    c_duckdb_query_arrow_error :: DuckDBArrow -> IO CString--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Closes the result and de-allocates all memory allocated for the arrow result.--Parameters:-* @result@: The result to destroy.--}-foreign import ccall safe "duckdb_destroy_arrow"-    c_duckdb_destroy_arrow :: Ptr DuckDBArrow -> IO ()--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Releases the arrow array stream and de-allocates its memory.--Parameters:-* @stream_p@: The arrow array stream to destroy.--}-foreign import ccall safe "duckdb_destroy_arrow_stream"-    c_duckdb_destroy_arrow_stream :: Ptr DuckDBArrowStream -> IO ()--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Executes the prepared statement with the given bound parameters, and returns-an arrow query result. Note that after running-@duckdb_execute_prepared_arrow@, @duckdb_destroy_arrow@ must be called on the-result object.--Parameters:-* @prepared_statement@: The prepared statement to execute.-* @out_result@: The query result.--Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.--}-foreign import ccall "duckdb_execute_prepared_arrow"-    c_duckdb_execute_prepared_arrow :: DuckDBPreparedStatement -> Ptr DuckDBArrow -> IO DuckDBState--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Scans the Arrow stream and creates a view with the given name.--Parameters:-* @connection@: The connection on which to execute the scan.-* @table_name@: Name of the temporary view to create.-* @arrow@: Arrow stream wrapper.--Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.--}-foreign import ccall "duckdb_arrow_scan"-    c_duckdb_arrow_scan :: DuckDBConnection -> CString -> DuckDBArrowStream -> IO DuckDBState--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Scans the Arrow array and creates a view with the given name. Note that after-running @duckdb_arrow_array_scan@, @duckdb_destroy_arrow_stream@ must be-called on the out stream.--Parameters:-* @connection@: The connection on which to execute the scan.-* @table_name@: Name of the temporary view to create.-* @arrow_schema@: Arrow schema wrapper.-* @arrow_array@: Arrow array wrapper.-* @out_stream@: Output array stream that wraps around the passed schema, for-  releasing/deleting once done.--Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.--}-foreign import ccall "duckdb_arrow_array_scan"-    c_duckdb_arrow_array_scan :: DuckDBConnection -> CString -> DuckDBArrowSchema -> DuckDBArrowArray -> Ptr DuckDBArrowStream -> IO DuckDBState--foreign import ccall safe "wrapped_duckdb_arrow_schema_internal_ptr"-    c_duckdb_arrow_schema_internal_ptr :: DuckDBArrowSchema -> IO (Ptr ())--foreign import ccall safe "wrapped_duckdb_arrow_schema_clear_internal_ptr"-    c_duckdb_arrow_schema_clear_internal_ptr :: DuckDBArrowSchema -> IO ()--foreign import ccall safe "wrapped_duckdb_arrow_array_internal_ptr"-    c_duckdb_arrow_array_internal_ptr :: DuckDBArrowArray -> IO (Ptr ())--foreign import ccall safe "wrapped_duckdb_arrow_array_clear_internal_ptr"-    c_duckdb_arrow_array_clear_internal_ptr :: DuckDBArrowArray -> IO ()--foreign import ccall safe "wrapped_duckdb_arrow_stream_internal_ptr"-    c_duckdb_arrow_stream_internal_ptr :: DuckDBArrowStream -> IO (Ptr ())--foreign import ccall safe "wrapped_duckdb_arrow_stream_clear_internal_ptr"-    c_duckdb_arrow_stream_clear_internal_ptr :: DuckDBArrowStream -> IO ()--{- | Read the @internal_ptr@ field of a deprecated Arrow schema wrapper.-Returns 'Nothing' when the wrapper is null or DuckDB has already cleared the-pointer.--}-duckdbArrowSchemaInternal :: DuckDBArrowSchema -> IO (Maybe ArrowSchemaPtr)-duckdbArrowSchemaInternal schema = do-    raw <- c_duckdb_arrow_schema_internal_ptr schema-    pure $-        if raw == nullPtr-            then Nothing-            else Just (ArrowSchemaPtr (castPtr raw))--{- | Clear the @internal_ptr@ field on a deprecated Arrow schema wrapper.-Useful after copying the schema to application-managed storage.--}-duckdbArrowSchemaClear :: DuckDBArrowSchema -> IO ()-duckdbArrowSchemaClear = c_duckdb_arrow_schema_clear_internal_ptr--{- | Read the @internal_ptr@ field of a deprecated Arrow array wrapper.-Returns 'Nothing' when the wrapper is null or the internal pointer has been-cleared by DuckDB.--}-duckdbArrowArrayInternal :: DuckDBArrowArray -> IO (Maybe ArrowArrayPtr)-duckdbArrowArrayInternal array = do-    raw <- c_duckdb_arrow_array_internal_ptr array-    pure $-        if raw == nullPtr-            then Nothing-            else Just (ArrowArrayPtr (castPtr raw))--{- | Clear the @internal_ptr@ field on a deprecated Arrow array wrapper.-After this call DuckDB treats the wrapper as null.--}-duckdbArrowArrayClear :: DuckDBArrowArray -> IO ()-duckdbArrowArrayClear = c_duckdb_arrow_array_clear_internal_ptr--{- | Read the @internal_ptr@ field of a deprecated Arrow stream wrapper.-Returns 'Nothing' when the wrapper is null or the stream has already been-released.--}-duckdbArrowStreamInternal :: DuckDBArrowStream -> IO (Maybe ArrowStreamPtr)-duckdbArrowStreamInternal stream = do-    raw <- c_duckdb_arrow_stream_internal_ptr stream-    pure $-        if raw == nullPtr-            then Nothing-            else Just (ArrowStreamPtr raw)--{- | Clear the @internal_ptr@ field on a deprecated Arrow stream wrapper.-Use this after consuming the stream via @duckdb_arrow_scan@ to avoid stale-pointers on the DuckDB side.--}-duckdbArrowStreamClear :: DuckDBArrowStream -> IO ()-duckdbArrowStreamClear = c_duckdb_arrow_stream_clear_internal_ptr
+ src/Database/DuckDB/FFI/Deprecated.hs view
@@ -0,0 +1,27 @@+{- |+Module      : Database.DuckDB.FFI.Deprecated+Description : Re-exports of deprecated DuckDB C API bindings.++This module gathers bindings that DuckDB has marked with a deprecation notice+so downstream code can opt-in to the legacy surface separately from the main+@Database.DuckDB.FFI@ module.+-}+module Database.DuckDB.FFI.Deprecated (+    module Database.DuckDB.FFI.Deprecated.Appender,+    module Database.DuckDB.FFI.Deprecated.Arrow,+    module Database.DuckDB.FFI.Deprecated.ExecutePrepared,+    module Database.DuckDB.FFI.Deprecated.PendingResult,+    module Database.DuckDB.FFI.Deprecated.QueryExecution,+    module Database.DuckDB.FFI.Deprecated.ResultFunctions,+    module Database.DuckDB.FFI.Deprecated.SafeFetch,+    module Database.DuckDB.FFI.Deprecated.StreamingResult,+) where++import Database.DuckDB.FFI.Deprecated.Appender+import Database.DuckDB.FFI.Deprecated.Arrow+import Database.DuckDB.FFI.Deprecated.ExecutePrepared+import Database.DuckDB.FFI.Deprecated.PendingResult+import Database.DuckDB.FFI.Deprecated.QueryExecution+import Database.DuckDB.FFI.Deprecated.ResultFunctions+import Database.DuckDB.FFI.Deprecated.SafeFetch+import Database.DuckDB.FFI.Deprecated.StreamingResult
+ src/Database/DuckDB/FFI/Deprecated/Appender.hs view
@@ -0,0 +1,23 @@+module Database.DuckDB.FFI.Deprecated.Appender (+    c_duckdb_appender_error,+) where++import Database.DuckDB.FFI.Types+import Foreign.C.String (CString)++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release. Use duckdb_appender_error_data instead.++Returns the error message associated with the appender. If the appender has no+error message, this returns @nullptr@ instead.++The error message should not be freed. It will be de-allocated when+@duckdb_appender_destroy@ is called.++Parameters:+* @appender@: The appender to get the error from.++Returns The error message, or @nullptr@ if there is none.+-}+foreign import ccall "duckdb_appender_error"+    c_duckdb_appender_error :: DuckDBAppender -> IO CString
+ src/Database/DuckDB/FFI/Deprecated/Arrow.hs view
@@ -0,0 +1,321 @@+module Database.DuckDB.FFI.Deprecated.Arrow (+    c_duckdb_query_arrow,+    c_duckdb_query_arrow_schema,+    c_duckdb_prepared_arrow_schema,+    c_duckdb_result_arrow_array,+    c_duckdb_query_arrow_array,+    c_duckdb_arrow_column_count,+    c_duckdb_arrow_row_count,+    c_duckdb_arrow_rows_changed,+    c_duckdb_query_arrow_error,+    c_duckdb_destroy_arrow,+    c_duckdb_destroy_arrow_stream,+    c_duckdb_execute_prepared_arrow,+    c_duckdb_arrow_scan,+    c_duckdb_arrow_array_scan,+    duckdbArrowSchemaInternal,+    duckdbArrowSchemaClear,+    duckdbArrowArrayInternal,+    duckdbArrowArrayClear,+    duckdbArrowStreamInternal,+    duckdbArrowStreamClear,+) where++import Database.DuckDB.FFI.Types+import Foreign.C.String (CString)+import Foreign.C.Types (CInt (..))+import Foreign.Ptr (Ptr, castPtr, nullPtr)++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++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@.++Note that after running @duckdb_query_arrow@, @duckdb_destroy_arrow@ must be+called on the result object even if the query fails, otherwise the error+stored within the result will not be freed correctly.++Parameters:+* @connection@: The connection to perform the query in.+* @query@: The SQL query to run.+* @out_result@: The query result.++Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.+-}+foreign import ccall "duckdb_query_arrow"+    c_duckdb_query_arrow :: DuckDBConnection -> CString -> Ptr DuckDBArrow -> IO DuckDBState++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Fetch the internal arrow schema from the arrow result. Remember to call+release on the respective ArrowSchema object.++Parameters:+* @result@: The result to fetch the schema from.+* @out_schema@: The output schema.++Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.+-}+foreign import ccall safe "duckdb_query_arrow_schema"+    c_duckdb_query_arrow_schema :: DuckDBArrow -> Ptr DuckDBArrowSchema -> IO DuckDBState++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Fetch the internal arrow schema from the prepared statement. Remember to call+release on the respective ArrowSchema object.++Parameters:+* @prepared@: The prepared statement to fetch the schema from.+* @out_schema@: The output schema.++Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.+-}+foreign import ccall safe "duckdb_prepared_arrow_schema"+    c_duckdb_prepared_arrow_schema :: DuckDBPreparedStatement -> Ptr DuckDBArrowSchema -> IO DuckDBState++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Convert a data chunk into an arrow struct array. Remember to call release on+the respective ArrowArray object.++Parameters:+* @result@: The result object the data chunk have been fetched from.+* @chunk@: The data chunk to convert.+* @out_array@: The output array.++These bindings call the wrapper symbol+@wrapped_duckdb_result_arrow_array@ but mirror the DuckDB C API semantics of+@duckdb_result_arrow_array@.+-}+foreign import ccall safe "wrapped_duckdb_result_arrow_array"+    c_duckdb_result_arrow_array :: Ptr DuckDBResult -> DuckDBDataChunk -> Ptr DuckDBArrowArray -> IO ()++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Fetch an internal arrow struct array from the arrow result. Remember to call+release on the respective ArrowArray object.++This function can be called multiple time to get next chunks, which will free+the previous out_array. So consume the out_array before calling this function+again.++Parameters:+* @result@: The result to fetch the array from.+* @out_array@: The output array.++Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.+-}+foreign import ccall "duckdb_query_arrow_array"+    c_duckdb_query_arrow_array :: DuckDBArrow -> Ptr DuckDBArrowArray -> IO DuckDBState++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns the number of columns present in the arrow result object.++Parameters:+* @result@: The result object.++Returns The number of columns present in the result object.+-}+foreign import ccall safe "duckdb_arrow_column_count"+    c_duckdb_arrow_column_count :: DuckDBArrow -> IO DuckDBIdx++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns the number of rows present in the arrow result object.++Parameters:+* @result@: The result object.++Returns The number of rows present in the result object.+-}+foreign import ccall safe "duckdb_arrow_row_count"+    c_duckdb_arrow_row_count :: DuckDBArrow -> IO DuckDBIdx++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++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.++Parameters:+* @result@: The result object.++Returns The number of rows changed.+-}+foreign import ccall safe "duckdb_arrow_rows_changed"+    c_duckdb_arrow_rows_changed :: DuckDBArrow -> IO DuckDBIdx++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns the error message contained within the result. The error is only set+if @duckdb_query_arrow@ returns @DuckDBError@.++The error message should not be freed. It will be de-allocated when+@duckdb_destroy_arrow@ is called.++Parameters:+* @result@: The result object to fetch the error from.++Returns The error of the result.+-}+foreign import ccall safe "duckdb_query_arrow_error"+    c_duckdb_query_arrow_error :: DuckDBArrow -> IO CString++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Closes the result and de-allocates all memory allocated for the arrow result.++Parameters:+* @result@: The result to destroy.+-}+foreign import ccall safe "duckdb_destroy_arrow"+    c_duckdb_destroy_arrow :: Ptr DuckDBArrow -> IO ()++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Releases the arrow array stream and de-allocates its memory.++Parameters:+* @stream_p@: The arrow array stream to destroy.+-}+foreign import ccall safe "duckdb_destroy_arrow_stream"+    c_duckdb_destroy_arrow_stream :: Ptr DuckDBArrowStream -> IO ()++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Executes the prepared statement with the given bound parameters, and returns+an arrow query result. Note that after running+@duckdb_execute_prepared_arrow@, @duckdb_destroy_arrow@ must be called on the+result object.++Parameters:+* @prepared_statement@: The prepared statement to execute.+* @out_result@: The query result.++Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.+-}+foreign import ccall "duckdb_execute_prepared_arrow"+    c_duckdb_execute_prepared_arrow :: DuckDBPreparedStatement -> Ptr DuckDBArrow -> IO DuckDBState++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Scans the Arrow stream and creates a view with the given name.++Parameters:+* @connection@: The connection on which to execute the scan.+* @table_name@: Name of the temporary view to create.+* @arrow@: Arrow stream wrapper.++Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.+-}+foreign import ccall "duckdb_arrow_scan"+    c_duckdb_arrow_scan :: DuckDBConnection -> CString -> DuckDBArrowStream -> IO DuckDBState++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Scans the Arrow array and creates a view with the given name. Note that after+running @duckdb_arrow_array_scan@, @duckdb_destroy_arrow_stream@ must be+called on the out stream.++Parameters:+* @connection@: The connection on which to execute the scan.+* @table_name@: Name of the temporary view to create.+* @arrow_schema@: Arrow schema wrapper.+* @arrow_array@: Arrow array wrapper.+* @out_stream@: Output array stream that wraps around the passed schema, for+  releasing/deleting once done.++Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.+-}+foreign import ccall "duckdb_arrow_array_scan"+    c_duckdb_arrow_array_scan :: DuckDBConnection -> CString -> DuckDBArrowSchema -> DuckDBArrowArray -> Ptr DuckDBArrowStream -> IO DuckDBState++foreign import ccall safe "wrapped_duckdb_arrow_schema_internal_ptr"+    c_duckdb_arrow_schema_internal_ptr :: DuckDBArrowSchema -> IO (Ptr ())++foreign import ccall safe "wrapped_duckdb_arrow_schema_clear_internal_ptr"+    c_duckdb_arrow_schema_clear_internal_ptr :: DuckDBArrowSchema -> IO ()++foreign import ccall safe "wrapped_duckdb_arrow_array_internal_ptr"+    c_duckdb_arrow_array_internal_ptr :: DuckDBArrowArray -> IO (Ptr ())++foreign import ccall safe "wrapped_duckdb_arrow_array_clear_internal_ptr"+    c_duckdb_arrow_array_clear_internal_ptr :: DuckDBArrowArray -> IO ()++foreign import ccall safe "wrapped_duckdb_arrow_stream_internal_ptr"+    c_duckdb_arrow_stream_internal_ptr :: DuckDBArrowStream -> IO (Ptr ())++foreign import ccall safe "wrapped_duckdb_arrow_stream_clear_internal_ptr"+    c_duckdb_arrow_stream_clear_internal_ptr :: DuckDBArrowStream -> IO ()++{- | Read the @internal_ptr@ field of a deprecated Arrow schema wrapper.+Returns 'Nothing' when the wrapper is null or DuckDB has already cleared the+pointer.+-}+duckdbArrowSchemaInternal :: DuckDBArrowSchema -> IO (Maybe ArrowSchemaPtr)+duckdbArrowSchemaInternal schema = do+    raw <- c_duckdb_arrow_schema_internal_ptr schema+    pure $+        if raw == nullPtr+            then Nothing+            else Just (ArrowSchemaPtr (castPtr raw))++{- | Clear the @internal_ptr@ field on a deprecated Arrow schema wrapper.+Useful after copying the schema to application-managed storage.+-}+duckdbArrowSchemaClear :: DuckDBArrowSchema -> IO ()+duckdbArrowSchemaClear = c_duckdb_arrow_schema_clear_internal_ptr++{- | Read the @internal_ptr@ field of a deprecated Arrow array wrapper.+Returns 'Nothing' when the wrapper is null or the internal pointer has been+cleared by DuckDB.+-}+duckdbArrowArrayInternal :: DuckDBArrowArray -> IO (Maybe ArrowArrayPtr)+duckdbArrowArrayInternal array = do+    raw <- c_duckdb_arrow_array_internal_ptr array+    pure $+        if raw == nullPtr+            then Nothing+            else Just (ArrowArrayPtr (castPtr raw))++{- | Clear the @internal_ptr@ field on a deprecated Arrow array wrapper.+After this call DuckDB treats the wrapper as null.+-}+duckdbArrowArrayClear :: DuckDBArrowArray -> IO ()+duckdbArrowArrayClear = c_duckdb_arrow_array_clear_internal_ptr++{- | Read the @internal_ptr@ field of a deprecated Arrow stream wrapper.+Returns 'Nothing' when the wrapper is null or the stream has already been+released.+-}+duckdbArrowStreamInternal :: DuckDBArrowStream -> IO (Maybe ArrowStreamPtr)+duckdbArrowStreamInternal stream = do+    raw <- c_duckdb_arrow_stream_internal_ptr stream+    pure $+        if raw == nullPtr+            then Nothing+            else Just (ArrowStreamPtr raw)++{- | Clear the @internal_ptr@ field on a deprecated Arrow stream wrapper.+Use this after consuming the stream via @duckdb_arrow_scan@ to avoid stale+pointers on the DuckDB side.+-}+duckdbArrowStreamClear :: DuckDBArrowStream -> IO ()+duckdbArrowStreamClear = c_duckdb_arrow_stream_clear_internal_ptr
+ src/Database/DuckDB/FFI/Deprecated/ExecutePrepared.hs view
@@ -0,0 +1,28 @@+module Database.DuckDB.FFI.Deprecated.ExecutePrepared (+    c_duckdb_execute_prepared_streaming,+) where++import Database.DuckDB.FFI.Types+import Foreign.C.Types (CInt (..))+import Foreign.Ptr (Ptr)++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Executes the prepared statement with the given bound parameters, and returns+an optionally-streaming query result. To determine if the resulting query was+in fact streamed, use @duckdb_result_is_streaming@++This method can be called multiple times for each prepared statement, and the+parameters can be modified between calls to this function.++Note that the result must be freed with @duckdb_destroy_result@.++Parameters:+* @prepared_statement@: The prepared statement to execute.+* @out_result@: The query result.++Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.+-}+foreign import ccall "duckdb_execute_prepared_streaming"+    c_duckdb_execute_prepared_streaming :: DuckDBPreparedStatement -> Ptr DuckDBResult -> IO DuckDBState
+ src/Database/DuckDB/FFI/Deprecated/PendingResult.hs view
@@ -0,0 +1,28 @@+module Database.DuckDB.FFI.Deprecated.PendingResult (+    c_duckdb_pending_prepared_streaming,+) where++import Database.DuckDB.FFI.Types+import Foreign.C.Types (CInt (..))+import Foreign.Ptr (Ptr)++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Executes the prepared statement with the given bound parameters, and returns a+pending result. This pending result will create a streaming duckdb_result when+executed. The pending result represents an intermediate structure for a query+that is not yet fully executed.++Note that after calling @duckdb_pending_prepared_streaming@, the pending+result should always be destroyed using @duckdb_destroy_pending@, even if this+function returns DuckDBError.++Parameters:+* @prepared_statement@: The prepared statement to execute.+* @out_result@: The pending query result.++Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.+-}+foreign import ccall "duckdb_pending_prepared_streaming"+    c_duckdb_pending_prepared_streaming :: DuckDBPreparedStatement -> Ptr DuckDBPendingResult -> IO DuckDBState
+ src/Database/DuckDB/FFI/Deprecated/QueryExecution.hs view
@@ -0,0 +1,69 @@+module Database.DuckDB.FFI.Deprecated.QueryExecution (+    c_duckdb_column_data,+    c_duckdb_nullmask_data,+    c_duckdb_row_count,+) where++import Database.DuckDB.FFI.Types+import Foreign.C.Types (CBool (..))+import Foreign.Ptr (Ptr)++{- | > Deprecated This method has been deprecated. Prefer using+@duckdb_result_get_chunk@ instead.++Returns the data of a specific column of a result in columnar format.++The function returns a dense array which contains the result data. The exact+type stored in the array depends on the corresponding duckdb_type (as provided+by @duckdb_column_type@). For the exact type by which the data should be+accessed, see the comments in [the types section](types) or the @DUCKDB_TYPE@+enum.++For example, for a column of type @DUCKDB_TYPE_INTEGER@, rows can be accessed+in the following manner: ``@c int32_t *data = (int32_t *)+duckdb_column_data(&result, 0); printf("Data for row %d: %d\n", row,+data[row]); @``++Parameters:+* @result@: The result object to fetch the column data from.+* @col@: The column index.++Returns The column data of the specified column.+-}+foreign import ccall safe "duckdb_column_data"+    c_duckdb_column_data :: Ptr DuckDBResult -> DuckDBIdx -> IO (Ptr ())++{- | > Deprecated This method has been deprecated. Prefer using+@duckdb_result_get_chunk@ instead.++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.++``@c int32_t *data = (int32_t *) duckdb_column_data(&result, 0); bool+*nullmask = duckdb_nullmask_data(&result, 0); if (nullmask[row]) {+printf("Data for row %d: NULL\n", row); } else { printf("Data for row %d:+%d\n", row, data[row]); } @``++Parameters:+* @result@: The result object to fetch the nullmask from.+* @col@: The column index.++Returns The nullmask of the specified column.+-}+foreign import ccall safe "duckdb_nullmask_data"+    c_duckdb_nullmask_data :: Ptr DuckDBResult -> DuckDBIdx -> IO (Ptr CBool)++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns the number of rows present in the result object.++Parameters:+* @result@: The result object.++Returns The number of rows present in the result object.+-}+foreign import ccall safe "duckdb_row_count"+    c_duckdb_row_count :: Ptr DuckDBResult -> IO DuckDBIdx
+ src/Database/DuckDB/FFI/Deprecated/ResultFunctions.hs view
@@ -0,0 +1,76 @@+module Database.DuckDB.FFI.Deprecated.ResultFunctions (+    c_duckdb_result_get_chunk,+    c_duckdb_result_is_streaming,+    c_duckdb_result_chunk_count,+) where++import Database.DuckDB.FFI.Types+import Foreign.C.Types (CBool (..))+import Foreign.Ptr (Ptr)++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Fetches a data chunk from the duckdb_result. This function should be called+repeatedly until the result is exhausted.++The result must be destroyed with @duckdb_destroy_data_chunk@.++This function supersedes all @duckdb_value@ functions, as well as the+@duckdb_column_data@ and @duckdb_nullmask_data@ functions. It results in+significantly better performance, and should be preferred in newer code-bases.++If this function is used, none of the other result functions can be used and+vice versa (i.e., this function cannot be mixed with the legacy result+functions).++Use @duckdb_result_chunk_count@ to figure out how many chunks there are in the+result.++Parameters:+* @result@: The result object to fetch the data chunk from.+* @chunk_index@: The chunk index to fetch from.++Returns The resulting data chunk. Returns @NULL@ if the chunk index is out of+bounds.++These bindings call the wrapper symbol+@wrapped_duckdb_result_get_chunk@ but mirror the DuckDB C API semantics of+@duckdb_result_get_chunk@.+-}+foreign import ccall safe "wrapped_duckdb_result_get_chunk"+    c_duckdb_result_get_chunk :: Ptr DuckDBResult -> DuckDBIdx -> IO DuckDBDataChunk++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Checks if the type of the internal result is StreamQueryResult.++Parameters:+* @result@: The result object to check.++Returns Whether or not the result object is of the type StreamQueryResult++These bindings call the wrapper symbol+@wrapped_duckdb_result_is_streaming@ but mirror the DuckDB C API semantics of+@duckdb_result_is_streaming@.+-}+foreign import ccall safe "wrapped_duckdb_result_is_streaming"+    c_duckdb_result_is_streaming :: Ptr DuckDBResult -> IO CBool++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns the number of data chunks present in the result.++Parameters:+* @result@: The result object++Returns Number of data chunks present in the result.++These bindings call the wrapper symbol+@wrapped_duckdb_result_chunk_count@ but mirror the DuckDB C API semantics of+@duckdb_result_chunk_count@.+-}+foreign import ccall safe "wrapped_duckdb_result_chunk_count"+    c_duckdb_result_chunk_count :: Ptr DuckDBResult -> IO DuckDBIdx
+ src/Database/DuckDB/FFI/Deprecated/SafeFetch.hs view
@@ -0,0 +1,280 @@+module Database.DuckDB.FFI.Deprecated.SafeFetch (+    c_duckdb_value_boolean,+    c_duckdb_value_int8,+    c_duckdb_value_int16,+    c_duckdb_value_int32,+    c_duckdb_value_int64,+    c_duckdb_value_hugeint,+    c_duckdb_value_uhugeint,+    c_duckdb_value_decimal,+    c_duckdb_value_uint8,+    c_duckdb_value_uint16,+    c_duckdb_value_uint32,+    c_duckdb_value_uint64,+    c_duckdb_value_float,+    c_duckdb_value_double,+    c_duckdb_value_date,+    c_duckdb_value_time,+    c_duckdb_value_timestamp,+    c_duckdb_value_interval,+    c_duckdb_value_string,+    c_duckdb_value_blob,+    c_duckdb_value_is_null,+    c_duckdb_value_varchar,+    c_duckdb_value_varchar_internal,+    c_duckdb_value_string_internal,+) where++import Data.Int (Int16, Int32, Int64, Int8)+import Data.Word (Word16, Word32, Word64, Word8)+import Database.DuckDB.FFI.Types+import Foreign.C.String (CString)+import Foreign.C.Types (CBool (..), CDouble (..), CFloat (..))+import Foreign.Ptr (Ptr)++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The boolean value at the specified location, or false if the value+cannot be converted.+-}+foreign import ccall safe "duckdb_value_boolean"+    c_duckdb_value_boolean :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CBool++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The int8_t value at the specified location, or 0 if the value cannot+be converted.+-}+foreign import ccall safe "duckdb_value_int8"+    c_duckdb_value_int8 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int8++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The int16_t value at the specified location, or 0 if the value cannot+be converted.+-}+foreign import ccall safe "duckdb_value_int16"+    c_duckdb_value_int16 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int16++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The int32_t value at the specified location, or 0 if the value cannot+be converted.+-}+foreign import ccall safe "duckdb_value_int32"+    c_duckdb_value_int32 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int32++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The int64_t value at the specified location, or 0 if the value cannot+be converted.+-}+foreign import ccall safe "duckdb_value_int64"+    c_duckdb_value_int64 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int64++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The duckdb_hugeint value at the specified location, or 0 if the value+cannot be converted.++These bindings call the wrapper symbol @wrapped_duckdb_value_hugeint@+but mirror the DuckDB C API semantics of @duckdb_value_hugeint@.+-}+foreign import ccall safe "wrapped_duckdb_value_hugeint"+    c_duckdb_value_hugeint :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBHugeInt -> IO ()++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The duckdb_uhugeint value at the specified location, or 0 if the value+cannot be converted.++These bindings call the wrapper symbol @wrapped_duckdb_value_uhugeint@+but mirror the DuckDB C API semantics of @duckdb_value_uhugeint@.+-}+foreign import ccall safe "wrapped_duckdb_value_uhugeint"+    c_duckdb_value_uhugeint :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBUHugeInt -> IO ()++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The duckdb_decimal value at the specified location, or 0 if the value+cannot be converted.++These bindings call the wrapper symbol @wrapped_duckdb_value_decimal@+but mirror the DuckDB C API semantics of @duckdb_value_decimal@.+-}+foreign import ccall safe "wrapped_duckdb_value_decimal"+    c_duckdb_value_decimal :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBDecimal -> IO ()++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The uint8_t value at the specified location, or 0 if the value cannot+be converted.+-}+foreign import ccall safe "duckdb_value_uint8"+    c_duckdb_value_uint8 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word8++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The uint16_t value at the specified location, or 0 if the value cannot+be converted.+-}+foreign import ccall safe "duckdb_value_uint16"+    c_duckdb_value_uint16 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word16++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The uint32_t value at the specified location, or 0 if the value cannot+be converted.+-}+foreign import ccall safe "duckdb_value_uint32"+    c_duckdb_value_uint32 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word32++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The uint64_t value at the specified location, or 0 if the value cannot+be converted.+-}+foreign import ccall safe "duckdb_value_uint64"+    c_duckdb_value_uint64 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word64++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The float value at the specified location, or 0 if the value cannot be+converted.+-}+foreign import ccall safe "duckdb_value_float"+    c_duckdb_value_float :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CFloat++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The double value at the specified location, or 0 if the value cannot+be converted.+-}+foreign import ccall safe "duckdb_value_double"+    c_duckdb_value_double :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CDouble++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The duckdb_date value at the specified location, or 0 if the value+cannot be converted.+-}+foreign import ccall safe "duckdb_value_date"+    c_duckdb_value_date :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO DuckDBDate++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The duckdb_time value at the specified location, or 0 if the value+cannot be converted.+-}+foreign import ccall safe "duckdb_value_time"+    c_duckdb_value_time :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO DuckDBTime++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The duckdb_timestamp value at the specified location, or 0 if the+value cannot be converted.+-}+foreign import ccall safe "duckdb_value_timestamp"+    c_duckdb_value_timestamp :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO DuckDBTimestamp++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns The duckdb_interval value at the specified location, or 0 if the value+cannot be converted.++These bindings call the wrapper symbol @wrapped_duckdb_value_interval@+but mirror the DuckDB C API semantics of @duckdb_value_interval@.+-}+foreign import ccall safe "wrapped_duckdb_value_interval"+    c_duckdb_value_interval :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBInterval -> IO ()++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++No support for nested types, and for other complex types. The resulting field+"string.data" must be freed with @duckdb_free.@ ++Returns The string value at the specified location. Attempts to cast the+result value to string.++These bindings call the wrapper symbol @wrapped_duckdb_value_string@+but mirror the DuckDB C API semantics of @duckdb_value_string@.+-}+foreign import ccall safe "wrapped_duckdb_value_string"+    c_duckdb_value_string :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBString -> IO ()++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++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 field+"blob.data" must be freed with @duckdb_free.@++These bindings call the wrapper symbol @wrapped_duckdb_value_blob@ but+mirror the DuckDB C API semantics of @duckdb_value_blob@.+-}+foreign import ccall safe "wrapped_duckdb_value_blob"+    c_duckdb_value_blob :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBBlob -> IO ()++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Returns Returns true if the value at the specified index is NULL, and false+otherwise.+-}+foreign import ccall safe "duckdb_value_is_null"+    c_duckdb_value_is_null :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CBool++{- | > Deprecated This method has been deprecated. Use duckdb_value_string instead.+This function does not work correctly if the string contains null bytes.++Returns The text value at the specified location as a null-terminated string,+or nullptr if the value cannot be converted. The result must be freed with+@duckdb_free@.+-}+foreign import ccall safe "duckdb_value_varchar"+    c_duckdb_value_varchar :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CString++{- | > Deprecated This method has been deprecated. Use duckdb_value_string_internal+instead. This function does not work correctly if the string contains null+bytes.++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. The result must NOT be freed.+-}+foreign import ccall safe "duckdb_value_varchar_internal"+    c_duckdb_value_varchar_internal :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CString++{- | > Deprecated This method has been deprecated. Use duckdb_value_string_internal+instead. This function does not work correctly if the string contains null+bytes.++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. The result must NOT be freed.++These bindings call the wrapper symbol+@wrapped_duckdb_value_string_internal@ but mirror the DuckDB C API semantics of+@duckdb_value_string_internal@.+-}+foreign import ccall safe "wrapped_duckdb_value_string_internal"+    c_duckdb_value_string_internal :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBString -> IO ()
+ src/Database/DuckDB/FFI/Deprecated/StreamingResult.hs view
@@ -0,0 +1,35 @@+module Database.DuckDB.FFI.Deprecated.StreamingResult (+    c_duckdb_stream_fetch_chunk,+) where++import Database.DuckDB.FFI.Types+import Foreign.Ptr (Ptr)++{- | > Warning Deprecation notice. This method is scheduled for removal in a future+release.++Fetches a data chunk from the (streaming) duckdb_result. This function should+be called repeatedly until the result is exhausted.++The result must be destroyed with @duckdb_destroy_data_chunk@.++This function can only be used on duckdb_results created with+@duckdb_pending_prepared_streaming@++If this function is used, none of the other result functions can be used and+vice versa (i.e., this function cannot be mixed with the legacy result+functions or the materialized result functions).++It is not known beforehand how many chunks will be returned by this result.++Parameters:+* @result@: The result object to fetch the data chunk from.++Returns The resulting data chunk. Returns @NULL@ if the result has an error.++These bindings call the wrapper symbol+@wrapped_duckdb_stream_fetch_chunk@ but mirror the DuckDB C API semantics of+@duckdb_stream_fetch_chunk@.+-}+foreign import ccall safe "wrapped_duckdb_stream_fetch_chunk"+    c_duckdb_stream_fetch_chunk :: Ptr DuckDBResult -> IO DuckDBDataChunk
src/Database/DuckDB/FFI/ExecutePrepared.hs view
@@ -1,6 +1,5 @@ module Database.DuckDB.FFI.ExecutePrepared (     c_duckdb_execute_prepared,-    c_duckdb_execute_prepared_streaming, ) where  import Database.DuckDB.FFI.Types@@ -23,24 +22,3 @@ -} foreign import ccall "duckdb_execute_prepared"     c_duckdb_execute_prepared :: DuckDBPreparedStatement -> Ptr DuckDBResult -> IO DuckDBState--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Executes the prepared statement with the given bound parameters, and returns-an optionally-streaming query result. To determine if the resulting query was-in fact streamed, use @duckdb_result_is_streaming@--This method can be called multiple times for each prepared statement, and the-parameters can be modified between calls to this function.--Note that the result must be freed with @duckdb_destroy_result@.--Parameters:-* @prepared_statement@: The prepared statement to execute.-* @out_result@: The query result.--Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.--}-foreign import ccall "duckdb_execute_prepared_streaming"-    c_duckdb_execute_prepared_streaming :: DuckDBPreparedStatement -> Ptr DuckDBResult -> IO DuckDBState
src/Database/DuckDB/FFI/PendingResult.hs view
@@ -1,6 +1,5 @@ module Database.DuckDB.FFI.PendingResult (     c_duckdb_pending_prepared,-    c_duckdb_pending_prepared_streaming,     c_duckdb_destroy_pending,     c_duckdb_pending_error,     c_duckdb_pending_execute_task,@@ -31,27 +30,6 @@ -} foreign import ccall "duckdb_pending_prepared"     c_duckdb_pending_prepared :: DuckDBPreparedStatement -> Ptr DuckDBPendingResult -> IO DuckDBState--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Executes the prepared statement with the given bound parameters, and returns a-pending result. This pending result will create a streaming duckdb_result when-executed. The pending result represents an intermediate structure for a query-that is not yet fully executed.--Note that after calling @duckdb_pending_prepared_streaming@, the pending-result should always be destroyed using @duckdb_destroy_pending@, even if this-function returns DuckDBError.--Parameters:-* @prepared_statement@: The prepared statement to execute.-* @out_result@: The pending query result.--Returns @DuckDBSuccess@ on success or @DuckDBError@ on failure.--}-foreign import ccall "duckdb_pending_prepared_streaming"-    c_duckdb_pending_prepared_streaming :: DuckDBPreparedStatement -> Ptr DuckDBPendingResult -> IO DuckDBState  {- | Closes the pending result and de-allocates all memory allocated for the result.
src/Database/DuckDB/FFI/QueryExecution.hs view
@@ -7,17 +7,14 @@     c_duckdb_column_logical_type,     c_duckdb_result_get_arrow_options,     c_duckdb_column_count,-    c_duckdb_row_count,     c_duckdb_rows_changed,-    c_duckdb_column_data,-    c_duckdb_nullmask_data,     c_duckdb_result_error,     c_duckdb_result_error_type, ) where  import Database.DuckDB.FFI.Types import Foreign.C.String (CString)-import Foreign.C.Types (CBool (..), CInt (..))+import Foreign.C.Types (CInt (..)) import Foreign.Ptr (Ptr)  {- | Executes a SQL query within a connection and stores the full (materialized)@@ -131,19 +128,6 @@ foreign import ccall safe "duckdb_column_count"     c_duckdb_column_count :: Ptr DuckDBResult -> IO DuckDBIdx -{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns the number of rows present in the result object.--Parameters:-* @result@: The result object.--Returns The number of rows present in the result object.--}-foreign import ccall safe "duckdb_row_count"-    c_duckdb_row_count :: Ptr DuckDBResult -> IO DuckDBIdx- {- | 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.@@ -155,53 +139,6 @@ -} foreign import ccall safe "duckdb_rows_changed"     c_duckdb_rows_changed :: Ptr DuckDBResult -> IO DuckDBIdx--{- | > Deprecated This method has been deprecated. Prefer using-@duckdb_result_get_chunk@ instead.--Returns the data of a specific column of a result in columnar format.--The function returns a dense array which contains the result data. The exact-type stored in the array depends on the corresponding duckdb_type (as provided-by @duckdb_column_type@). For the exact type by which the data should be-accessed, see the comments in [the types section](types) or the @DUCKDB_TYPE@-enum.--For example, for a column of type @DUCKDB_TYPE_INTEGER@, rows can be accessed-in the following manner: ``@c int32_t *data = (int32_t *)-duckdb_column_data(&result, 0); printf("Data for row %d: %d\n", row,-data[row]); @``--Parameters:-* @result@: The result object to fetch the column data from.-* @col@: The column index.--Returns The column data of the specified column.--}-foreign import ccall safe "duckdb_column_data"-    c_duckdb_column_data :: Ptr DuckDBResult -> DuckDBIdx -> IO (Ptr ())--{- | > Deprecated This method has been deprecated. Prefer using-@duckdb_result_get_chunk@ instead.--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.--``@c int32_t *data = (int32_t *) duckdb_column_data(&result, 0); bool-*nullmask = duckdb_nullmask_data(&result, 0); if (nullmask[row]) {-printf("Data for row %d: NULL\n", row); } else { printf("Data for row %d:-%d\n", row, data[row]); } @``--Parameters:-* @result@: The result object to fetch the nullmask from.-* @col@: The column index.--Returns The nullmask of the specified column.--}-foreign import ccall safe "duckdb_nullmask_data"-    c_duckdb_nullmask_data :: Ptr DuckDBResult -> DuckDBIdx -> IO (Ptr CBool)  {- | Returns the error message contained within the result. The error is only set if @duckdb_query@ returns @DuckDBError@.
src/Database/DuckDB/FFI/ResultFunctions.hs view
@@ -1,80 +1,10 @@ module Database.DuckDB.FFI.ResultFunctions (-    c_duckdb_result_get_chunk,-    c_duckdb_result_is_streaming,-    c_duckdb_result_chunk_count,     c_duckdb_result_return_type, ) where  import Database.DuckDB.FFI.Types-import Foreign.C.Types (CBool (..), CInt (..))+import Foreign.C.Types (CInt (..)) import Foreign.Ptr (Ptr)--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Fetches a data chunk from the duckdb_result. This function should be called-repeatedly until the result is exhausted.--The result must be destroyed with @duckdb_destroy_data_chunk@.--This function supersedes all @duckdb_value@ functions, as well as the-@duckdb_column_data@ and @duckdb_nullmask_data@ functions. It results in-significantly better performance, and should be preferred in newer code-bases.--If this function is used, none of the other result functions can be used and-vice versa (i.e., this function cannot be mixed with the legacy result-functions).--Use @duckdb_result_chunk_count@ to figure out how many chunks there are in the-result.--Parameters:-* @result@: The result object to fetch the data chunk from.-* @chunk_index@: The chunk index to fetch from.--Returns The resulting data chunk. Returns @NULL@ if the chunk index is out of-bounds.--These bindings call the wrapper symbol-@wrapped_duckdb_result_get_chunk@ but mirror the DuckDB C API semantics of-@duckdb_result_get_chunk@.--}-foreign import ccall safe "wrapped_duckdb_result_get_chunk"-    c_duckdb_result_get_chunk :: Ptr DuckDBResult -> DuckDBIdx -> IO DuckDBDataChunk--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Checks if the type of the internal result is StreamQueryResult.--Parameters:-* @result@: The result object to check.--Returns Whether or not the result object is of the type StreamQueryResult--These bindings call the wrapper symbol-@wrapped_duckdb_result_is_streaming@ but mirror the DuckDB C API semantics of-@duckdb_result_is_streaming@.--}-foreign import ccall safe "wrapped_duckdb_result_is_streaming"-    c_duckdb_result_is_streaming :: Ptr DuckDBResult -> IO CBool--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns the number of data chunks present in the result.--Parameters:-* @result@: The result object--Returns Number of data chunks present in the result.--These bindings call the wrapper symbol-@wrapped_duckdb_result_chunk_count@ but mirror the DuckDB C API semantics of-@duckdb_result_chunk_count@.--}-foreign import ccall safe "wrapped_duckdb_result_chunk_count"-    c_duckdb_result_chunk_count :: Ptr DuckDBResult -> IO DuckDBIdx  {- | Returns the return_type of the given result, or DUCKDB_RETURN_TYPE_INVALID on error
− src/Database/DuckDB/FFI/SafeFetch.hs
@@ -1,280 +0,0 @@-module Database.DuckDB.FFI.SafeFetch (-    c_duckdb_value_boolean,-    c_duckdb_value_int8,-    c_duckdb_value_int16,-    c_duckdb_value_int32,-    c_duckdb_value_int64,-    c_duckdb_value_hugeint,-    c_duckdb_value_uhugeint,-    c_duckdb_value_decimal,-    c_duckdb_value_uint8,-    c_duckdb_value_uint16,-    c_duckdb_value_uint32,-    c_duckdb_value_uint64,-    c_duckdb_value_float,-    c_duckdb_value_double,-    c_duckdb_value_date,-    c_duckdb_value_time,-    c_duckdb_value_timestamp,-    c_duckdb_value_interval,-    c_duckdb_value_varchar,-    c_duckdb_value_string,-    c_duckdb_value_varchar_internal,-    c_duckdb_value_string_internal,-    c_duckdb_value_blob,-    c_duckdb_value_is_null,-) where--import Data.Int (Int16, Int32, Int64, Int8)-import Data.Word (Word16, Word32, Word64, Word8)-import Database.DuckDB.FFI.Types-import Foreign.C.String (CString)-import Foreign.C.Types (CBool (..), CDouble (..), CFloat (..))-import Foreign.Ptr (Ptr)--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The boolean value at the specified location, or false if the value-cannot be converted.--}-foreign import ccall safe "duckdb_value_boolean"-    c_duckdb_value_boolean :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CBool--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The int8_t value at the specified location, or 0 if the value cannot-be converted.--}-foreign import ccall safe "duckdb_value_int8"-    c_duckdb_value_int8 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int8--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The int16_t value at the specified location, or 0 if the value cannot-be converted.--}-foreign import ccall safe "duckdb_value_int16"-    c_duckdb_value_int16 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int16--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The int32_t value at the specified location, or 0 if the value cannot-be converted.--}-foreign import ccall safe "duckdb_value_int32"-    c_duckdb_value_int32 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int32--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The int64_t value at the specified location, or 0 if the value cannot-be converted.--}-foreign import ccall safe "duckdb_value_int64"-    c_duckdb_value_int64 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Int64--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The duckdb_hugeint value at the specified location, or 0 if the value-cannot be converted.--These bindings call the wrapper symbol @wrapped_duckdb_value_hugeint@-but mirror the DuckDB C API semantics of @duckdb_value_hugeint@.--}-foreign import ccall safe "wrapped_duckdb_value_hugeint"-    c_duckdb_value_hugeint :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBHugeInt -> IO ()--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The duckdb_uhugeint value at the specified location, or 0 if the value-cannot be converted.--These bindings call the wrapper symbol @wrapped_duckdb_value_uhugeint@-but mirror the DuckDB C API semantics of @duckdb_value_uhugeint@.--}-foreign import ccall safe "wrapped_duckdb_value_uhugeint"-    c_duckdb_value_uhugeint :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBUHugeInt -> IO ()--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The duckdb_decimal value at the specified location, or 0 if the value-cannot be converted.--These bindings call the wrapper symbol @wrapped_duckdb_value_decimal@-but mirror the DuckDB C API semantics of @duckdb_value_decimal@.--}-foreign import ccall safe "wrapped_duckdb_value_decimal"-    c_duckdb_value_decimal :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBDecimal -> IO ()--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The uint8_t value at the specified location, or 0 if the value cannot-be converted.--}-foreign import ccall safe "duckdb_value_uint8"-    c_duckdb_value_uint8 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word8--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The uint16_t value at the specified location, or 0 if the value cannot-be converted.--}-foreign import ccall safe "duckdb_value_uint16"-    c_duckdb_value_uint16 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word16--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The uint32_t value at the specified location, or 0 if the value cannot-be converted.--}-foreign import ccall safe "duckdb_value_uint32"-    c_duckdb_value_uint32 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word32--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The uint64_t value at the specified location, or 0 if the value cannot-be converted.--}-foreign import ccall safe "duckdb_value_uint64"-    c_duckdb_value_uint64 :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO Word64--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The float value at the specified location, or 0 if the value cannot be-converted.--}-foreign import ccall safe "duckdb_value_float"-    c_duckdb_value_float :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CFloat--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The double value at the specified location, or 0 if the value cannot-be converted.--}-foreign import ccall safe "duckdb_value_double"-    c_duckdb_value_double :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CDouble--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The duckdb_date value at the specified location, or 0 if the value-cannot be converted.--}-foreign import ccall safe "duckdb_value_date"-    c_duckdb_value_date :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO DuckDBDate--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The duckdb_time value at the specified location, or 0 if the value-cannot be converted.--}-foreign import ccall safe "duckdb_value_time"-    c_duckdb_value_time :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO DuckDBTime--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The duckdb_timestamp value at the specified location, or 0 if the-value cannot be converted.--}-foreign import ccall safe "duckdb_value_timestamp"-    c_duckdb_value_timestamp :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO DuckDBTimestamp--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns The duckdb_interval value at the specified location, or 0 if the value-cannot be converted.--These bindings call the wrapper symbol @wrapped_duckdb_value_interval@-but mirror the DuckDB C API semantics of @duckdb_value_interval@.--}-foreign import ccall safe "wrapped_duckdb_value_interval"-    c_duckdb_value_interval :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBInterval -> IO ()--{- | > Deprecated This method has been deprecated. Use duckdb_value_string instead.-This function does not work correctly if the string contains null bytes.--Returns The text value at the specified location as a null-terminated string,-or nullptr if the value cannot be converted. The result must be freed with-@duckdb_free@.--}-foreign import ccall safe "duckdb_value_varchar"-    c_duckdb_value_varchar :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CString--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--No support for nested types, and for other complex types. The resulting field-"string.data" must be freed with @duckdb_free.@--Returns The string value at the specified location. Attempts to cast the-result value to string.--These bindings call the wrapper symbol @wrapped_duckdb_value_string@-but mirror the DuckDB C API semantics of @duckdb_value_string@.--}-foreign import ccall safe "wrapped_duckdb_value_string"-    c_duckdb_value_string :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBString -> IO ()--{- | > Deprecated This method has been deprecated. Use duckdb_value_string_internal-instead. This function does not work correctly if the string contains null-bytes.--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. The result must NOT be freed.--}-foreign import ccall safe "duckdb_value_varchar_internal"-    c_duckdb_value_varchar_internal :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CString--{- | > Deprecated This method has been deprecated. Use duckdb_value_string_internal-instead. This function does not work correctly if the string contains null-bytes.--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. The result must NOT be freed.--These bindings call the wrapper symbol-@wrapped_duckdb_value_string_internal@ but mirror the DuckDB C API semantics of-@duckdb_value_string_internal@.--}-foreign import ccall safe "wrapped_duckdb_value_string_internal"-    c_duckdb_value_string_internal :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBString -> IO ()--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--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 field-"blob.data" must be freed with @duckdb_free.@--These bindings call the wrapper symbol @wrapped_duckdb_value_blob@ but-mirror the DuckDB C API semantics of @duckdb_value_blob@.--}-foreign import ccall safe "wrapped_duckdb_value_blob"-    c_duckdb_value_blob :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> Ptr DuckDBBlob -> IO ()--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Returns Returns true if the value at the specified index is NULL, and false-otherwise.--}-foreign import ccall safe "duckdb_value_is_null"-    c_duckdb_value_is_null :: Ptr DuckDBResult -> DuckDBIdx -> DuckDBIdx -> IO CBool
src/Database/DuckDB/FFI/StreamingResult.hs view
@@ -1,39 +1,9 @@ module Database.DuckDB.FFI.StreamingResult (-    c_duckdb_stream_fetch_chunk,     c_duckdb_fetch_chunk, ) where  import Database.DuckDB.FFI.Types import Foreign.Ptr (Ptr)--{- | > Warning Deprecation notice. This method is scheduled for removal in a future-release.--Fetches a data chunk from the (streaming) duckdb_result. This function should-be called repeatedly until the result is exhausted.--The result must be destroyed with @duckdb_destroy_data_chunk@.--This function can only be used on duckdb_results created with-@duckdb_pending_prepared_streaming@--If this function is used, none of the other result functions can be used and-vice versa (i.e., this function cannot be mixed with the legacy result-functions or the materialized result functions).--It is not known beforehand how many chunks will be returned by this result.--Parameters:-* @result@: The result object to fetch the data chunk from.--Returns The resulting data chunk. Returns @NULL@ if the result has an error.--These bindings call the wrapper symbol-@wrapped_duckdb_stream_fetch_chunk@ but mirror the DuckDB C API semantics of-@duckdb_stream_fetch_chunk@.--}-foreign import ccall safe "wrapped_duckdb_stream_fetch_chunk"-    c_duckdb_stream_fetch_chunk :: Ptr DuckDBResult -> IO DuckDBDataChunk  {- | Fetches a data chunk from a duckdb_result. This function should be called repeatedly until the result is exhausted.
test/AggregateFunctionsTest.hs view
@@ -10,6 +10,7 @@ import Data.List (isInfixOf) import Data.Word (Word64) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (CString, peekCString, withCString) import Foreign.C.Types (CBool (..)) import Foreign.Marshal.Alloc (alloca, free, mallocBytes)
test/AppenderTest.hs view
@@ -9,6 +9,7 @@ import Data.List (isInfixOf) import Data.Word (Word16, Word32, Word64, Word8) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (peekCString, withCString, withCStringLen) import Foreign.C.Types (CBool (..)) import Foreign.Marshal.Alloc (alloca)
test/ArrowInterfaceDeprecatedTests.hs view
@@ -9,6 +9,7 @@ import Data.List (isInfixOf) import Data.Maybe (isNothing) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (peekCString, peekCStringLen, withCString) import Foreign.C.Types (CChar) import Foreign.Marshal.Alloc (alloca)
test/BindValuesTest.hs view
@@ -8,6 +8,7 @@ import Data.Time.Calendar (diffDays, fromGregorian) import Data.Word (Word16, Word32, Word64, Word8) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (peekCString, peekCStringLen, withCString) import Foreign.C.Types (CBool (..), CDouble (..), CFloat (..)) import Foreign.Marshal.Alloc (alloca)
test/CastFunctionsTest.hs view
@@ -10,6 +10,7 @@ import Data.Int (Int32) import Data.List (isInfixOf) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (peekCString, withCString, withCStringLen) import Foreign.C.Types (CBool (..)) import Foreign.Marshal.Alloc (alloca)
test/ExecutePreparedStatementsTest.hs view
@@ -4,6 +4,7 @@  import Control.Monad (forM_) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (peekCString, withCString) import Foreign.C.Types (CBool (..)) import Foreign.Marshal.Alloc (alloca)
test/ExtractStatementsTest.hs view
@@ -5,6 +5,7 @@ import Control.Monad (forM_, when) import Data.Int (Int64) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (peekCString, withCString) import Foreign.Marshal.Alloc (alloca) import Foreign.Ptr (nullPtr)
test/LogicalTypesTest.hs view
@@ -5,6 +5,7 @@ import Control.Monad (forM_, when, (>=>)) import Data.Word (Word32, Word8) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (peekCString, withCString) import Foreign.Marshal.Array (withArray) import Foreign.Marshal.Utils (withMany)
test/PendingResultTest.hs view
@@ -6,6 +6,7 @@ import Data.Int (Int32, Int64) import Data.Maybe (isNothing) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (peekCString, withCString) import Foreign.C.Types (CBool (..)) import Foreign.Marshal.Alloc (alloca)
test/QueryExecutionTest.hs view
@@ -4,6 +4,7 @@  import Control.Monad (forM_, when) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (peekCString, withCString) import Foreign.Marshal.Alloc (alloca) import Foreign.Ptr (nullPtr)
test/ReplacementScansTest.hs view
@@ -9,6 +9,7 @@ import Data.Int (Int64) import Data.List (isInfixOf) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (CString, peekCString, withCString) import Foreign.Marshal.Alloc (alloca) import Foreign.Ptr (Ptr, freeHaskellFunPtr, nullFunPtr, nullPtr)
test/ResultFunctionsTest.hs view
@@ -4,6 +4,7 @@  import Control.Monad (forM_, when) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (withCString) import Foreign.C.Types (CBool (..)) import Foreign.Marshal.Alloc (alloca)
test/SafeFetchTest.hs view
@@ -7,6 +7,7 @@ import Data.Time.Calendar (diffDays, fromGregorian) import Data.Word (Word16, Word32, Word64, Word8) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (peekCString, peekCStringLen, withCString) import Foreign.C.Types (CBool (..)) import Foreign.Marshal.Alloc (alloca)
test/ScalarFunctionsTest.hs view
@@ -9,6 +9,7 @@ import Data.Int (Int32) import Data.List (isInfixOf) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (peekCString, withCString) import Foreign.Marshal.Alloc (alloca, free, mallocBytes) import Foreign.Ptr (Ptr, castPtr, nullPtr)
test/StreamingResultTest.hs view
@@ -6,6 +6,7 @@ import Data.Int (Int64) import Data.List (intercalate) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (CString, withCString) import Foreign.C.Types (CBool (..)) import Foreign.Marshal.Alloc (alloca)
test/TableFunctionsTest.hs view
@@ -13,6 +13,7 @@ import Data.List (isInfixOf) import Data.Maybe (fromMaybe) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (CString, peekCString, withCString) import Foreign.C.Types (CBool (..)) import Foreign.Marshal.Alloc (alloca, free, mallocBytes)
test/ThreadingTest.hs view
@@ -5,6 +5,7 @@ import Control.Concurrent (forkFinally, newEmptyMVar, putMVar, takeMVar) import Data.Int (Int64) import Database.DuckDB.FFI+import Database.DuckDB.FFI.Deprecated import Foreign.C.String (CString, withCString) import Foreign.C.Types (CBool (..)) import Foreign.Marshal.Alloc (alloca)