| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.DuckDB.Simple.Internal
Description
This module provides access to the opaque data constructors and helper
utilities required by the high-level API. It is not part of the supported
public interface; consumers should depend on Database.DuckDB.Simple instead.
Synopsis
- newtype Query = Query {}
- newtype Connection = Connection {}
- data ConnectionState
- data Statement = Statement {}
- data StatementState
- data StatementStreamState
- data StatementStream = StatementStream {}
- data StatementStreamColumn = StatementStreamColumn {}
- data StatementStreamChunk = StatementStreamChunk {}
- data StatementStreamChunkVector = StatementStreamChunkVector {}
- data SQLError = SQLError {}
- toSQLError :: Exception e => e -> SQLError
- connectionClosedError :: SQLError
- statementClosedError :: Statement -> SQLError
- withDatabaseHandle :: Connection -> (DuckDBDatabase -> IO a) -> IO a
- withConnectionHandle :: Connection -> (DuckDBConnection -> IO a) -> IO a
- withStatementHandle :: Statement -> (DuckDBPreparedStatement -> IO a) -> IO a
- withQueryCString :: Query -> (CString -> IO a) -> IO a
- withClientContext :: Connection -> (DuckDBClientContext -> IO a) -> IO a
- destroyClientContext :: DuckDBClientContext -> IO ()
- destroyValue :: DuckDBValue -> IO ()
- destroyLogicalType :: DuckDBLogicalType -> IO ()
- throwRegistrationError :: String -> IO a
- releaseStablePtrData :: Ptr () -> IO ()
- mkDeleteCallback :: (Ptr () -> IO ()) -> IO DuckDBDeleteCallback
Data constructors (internal use only)
Represents a textual SQL query with UTF-8 encoding semantics.
Constructors
| Query | |
newtype Connection Source #
Tracks the lifetime of a DuckDB database and connection pair.
Constructors
| Connection | |
Fields | |
data ConnectionState Source #
Internal connection lifecycle state.
Constructors
| ConnectionClosed | |
| ConnectionOpen | |
Tracks the lifetime of a prepared statement.
Constructors
| Statement | |
data StatementState Source #
Internal statement lifecycle state.
Constructors
| StatementClosed | |
| StatementOpen | |
Fields | |
data StatementStreamState Source #
Streaming execution state for prepared statements.
Constructors
| StatementStreamIdle | |
| StatementStreamActive !StatementStream |
data StatementStream Source #
Streaming cursor backing an active result set.
Constructors
| StatementStream | |
data StatementStreamColumn Source #
Metadata describing a result column surfaced through streaming.
Constructors
| StatementStreamColumn | |
data StatementStreamChunk Source #
Currently loaded data chunk plus iteration cursor.
data StatementStreamChunkVector Source #
Raw vector pointers backing a chunk column.
Constructors
| StatementStreamChunkVector | |
Represents an error reported by DuckDB or by duckdb-simple itself.
Constructors
| SQLError | |
Fields | |
Instances
| Exception SQLError Source # | |
Defined in Database.DuckDB.Simple.Internal Methods toException :: SQLError -> SomeException # fromException :: SomeException -> Maybe SQLError # displayException :: SQLError -> String # backtraceDesired :: SQLError -> Bool # | |
| Show SQLError Source # | |
| Eq SQLError Source # | |
toSQLError :: Exception e => e -> SQLError Source #
Convert an arbitrary exception into an untyped SQLError.
Helpers
connectionClosedError :: SQLError Source #
Shared error value used when an operation targets a closed connection.
statementClosedError :: Statement -> SQLError Source #
Shared error value used when an operation targets a closed statement.
withDatabaseHandle :: Connection -> (DuckDBDatabase -> IO a) -> IO a Source #
Internal helper for safely accessing the underlying database handle.
withConnectionHandle :: Connection -> (DuckDBConnection -> IO a) -> IO a Source #
Internal helper for safely accessing the underlying connection handle.
withStatementHandle :: Statement -> (DuckDBPreparedStatement -> IO a) -> IO a Source #
Internal helper for safely accessing the underlying prepared statement.
withQueryCString :: Query -> (CString -> IO a) -> IO a Source #
Provide a UTF-8 encoded C string view of the query text.
withClientContext :: Connection -> (DuckDBClientContext -> IO a) -> IO a Source #
Acquire the client context for the connection, destroying it after the action.
destroyClientContext :: DuckDBClientContext -> IO () Source #
Destroy a client context handle.
destroyValue :: DuckDBValue -> IO () Source #
Destroy a value handle.
destroyLogicalType :: DuckDBLogicalType -> IO () Source #
Destroy a logical type handle.
throwRegistrationError :: String -> IO a Source #
Throw a standardised registration error.
releaseStablePtrData :: Ptr () -> IO () Source #
Free a stable pointer stored behind a raw Ptr ().
mkDeleteCallback :: (Ptr () -> IO ()) -> IO DuckDBDeleteCallback Source #
Create a DuckDB delete callback from a Haskell function.