duckdb-simple
Safe HaskellNone
LanguageHaskell2010

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

Data constructors (internal use only)

newtype Query Source #

Represents a textual SQL query with UTF-8 encoding semantics.

Constructors

Query 

Fields

  • fromQuery :: Text

    Extract the underlying textual representation of the query.

Instances

Instances details
Semigroup Query Source # 
Instance details

Defined in Database.DuckDB.Simple.Internal

Methods

(<>) :: Query -> Query -> Query #

sconcat :: NonEmpty Query -> Query #

stimes :: Integral b => b -> Query -> Query #

IsString Query Source # 
Instance details

Defined in Database.DuckDB.Simple.Internal

Methods

fromString :: String -> Query #

Show Query Source # 
Instance details

Defined in Database.DuckDB.Simple.Internal

Methods

showsPrec :: Int -> Query -> ShowS #

show :: Query -> String #

showList :: [Query] -> ShowS #

Eq Query Source # 
Instance details

Defined in Database.DuckDB.Simple.Internal

Methods

(==) :: Query -> Query -> Bool #

(/=) :: Query -> Query -> Bool #

Ord Query Source # 
Instance details

Defined in Database.DuckDB.Simple.Internal

Methods

compare :: Query -> Query -> Ordering #

(<) :: Query -> Query -> Bool #

(<=) :: Query -> Query -> Bool #

(>) :: Query -> Query -> Bool #

(>=) :: Query -> Query -> Bool #

max :: Query -> Query -> Query #

min :: Query -> Query -> Query #

newtype Connection Source #

Tracks the lifetime of a DuckDB database and connection pair.

data StatementState Source #

Internal statement lifecycle state.

data StatementStreamState Source #

Streaming execution state for prepared statements.

data StatementStreamColumn Source #

Metadata describing a result column surfaced through streaming.

data SQLError Source #

Represents an error reported by DuckDB or by duckdb-simple itself.

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.