Safe Haskell | Safe-Inferred |
---|---|
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 Simple
instead.
Synopsis
- newtype Query = Query {}
- newtype Connection = Connection {}
- data ConnectionState
- = ConnectionClosed
- | ConnectionOpen {
- connectionDatabase :: DuckDBDatabase
- connectionHandle :: DuckDBConnection
- data Statement = Statement {}
- data StatementState
- = StatementClosed
- | StatementOpen {
- statementHandle :: DuckDBPreparedStatement
- data StatementStreamState
- data StatementStream = StatementStream {
- statementStreamResult :: Ptr DuckDBResult
- statementStreamColumns :: [StatementStreamColumn]
- statementStreamChunk :: Maybe StatementStreamChunk
- data StatementStreamColumn = StatementStreamColumn {
- statementStreamColumnIndex :: Int
- statementStreamColumnName :: Text
- statementStreamColumnType :: DuckDBType
- data StatementStreamChunk = StatementStreamChunk {
- statementStreamChunkPtr :: DuckDBDataChunk
- statementStreamChunkSize :: Int
- statementStreamChunkIndex :: Int
- statementStreamChunkVectors :: [StatementStreamChunkVector]
- data StatementStreamChunkVector = StatementStreamChunkVector {
- statementStreamChunkVectorHandle :: DuckDBVector
- statementStreamChunkVectorData :: Ptr ()
- statementStreamChunkVectorValidity :: Ptr Word64
- data SQLError = SQLError {
- sqlErrorMessage :: Text
- sqlErrorType :: Maybe DuckDBErrorType
- sqlErrorQuery :: Maybe Query
- toSQLError :: Exception e => e -> SQLError
- connectionClosedError :: SQLError
- statementClosedError :: Statement -> SQLError
- withConnectionHandle :: Connection -> (DuckDBConnection -> IO a) -> IO a
- withStatementHandle :: Statement -> (DuckDBPreparedStatement -> IO a) -> IO a
- withQueryCString :: Query -> (CString -> IO a) -> IO a
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 | |
Fields
|
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 | |
Fields
|
data StatementStreamColumn Source #
Metadata describing a result column surfaced through streaming.
Constructors
StatementStreamColumn | |
Fields
|
data StatementStreamChunk Source #
Currently loaded data chunk plus iteration cursor.
Constructors
StatementStreamChunk | |
Fields
|
data StatementStreamChunkVector Source #
Raw vector pointers backing a chunk column.
Constructors
StatementStreamChunkVector | |
Fields
|
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 # | |
Show SQLError Source # | |
Eq SQLError Source # | |
toSQLError :: Exception e => e -> SQLError Source #
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.
withConnectionHandle :: Connection -> (DuckDBConnection -> IO a) -> IO a Source #
Internal helper for safely accessing the underlying connection handle.