odpic-raw-0.1.0

Copyright(c) Daniel YU
LicenseBSD3
Maintainerleptonyu@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Database.Dpi

Contents

Description

FFI raw bindings to ODPI-C

Synopsis

Context Interface

destroyContext :: PtrContext -> IO Bool Source #

Destroy Context

withContext :: (PtrContext -> IO a) -> IO a Source #

With Context, PtrContext will be destroyed after run

Information from Context

Connection Interface

createConnection Source #

Arguments

:: PtrContext

Context

-> ByteString

Username

-> ByteString

Password

-> ByteString

Connection String

-> (Data_CommonCreateParams -> Data_CommonCreateParams)

custom Data_CommonCreateParams

-> IO PtrConn 

Create Connection

closeConnection :: ConnCloseMode -> PtrConn -> IO Bool Source #

close connection, but not release resource, plese use releaseConnection to release and close connection

pingConnection :: PtrConn -> IO Bool Source #

ping to check connection available

withConnection Source #

Arguments

:: PtrContext

Context

-> ByteString

Username

-> ByteString

Password

-> ByteString

Connection String

-> ByteString

NLS_LANG encoding

-> ByteString

NLS_NCHAR encoding

-> (PtrConn -> IO a)

action use connection

-> IO a 

with connection

Transaction Interface

beginTransaction Source #

Arguments

:: PtrConn

Connection

-> Int64

formatId

-> ByteString

transactionId

-> ByteString

branchId

-> IO Bool 

releaseConnection :: PtrConn -> IO Bool Source #

release and close connection

Information from Connection

Statement Interface

createStatement Source #

Arguments

:: PtrConn

Connection

-> Bool

scrollable

-> ByteString

SQL String

-> IO PtrStmt 

Create Statement

Statement Bind Vars

getQueryValue :: PtrStmt -> Int -> IO DataValue Source #

Execute Statement

type FetchRows a = Page -> IO a Source #

Lob Interface

Object Interface

Rowid Interface

Var Interface

newVar Source #

Arguments

:: PtrConn

Connection

-> OracleTypeNum

Oracle type enum

-> NativeTypeNum

Native type enum

-> Int

maxArraySize

-> Int

size

-> Bool

sizeIsBytes

-> Bool

isArray

-> PtrObjectType

Object type

-> IO (PtrVar, [PtrData]) 

type PtrConn = Ptr DPI_Conn Source #

type PtrPool = Ptr DPI_Pool Source #

type PtrStmt = Ptr DPI_Stmt Source #

type PtrVar = Ptr DPI_Var Source #

type PtrLob = Ptr DPI_Lob Source #

type PtrObject = Ptr DPI_Object Source #

type PtrObjectAttr = Ptr DPI_ObjectAttr Source #

type PtrObjectType = Ptr DPI_ObjectType Source #

type PtrRowid = Ptr DPI_Rowid Source #

type PtrSubscr = Ptr DPI_Subscr Source #

type PtrDeqOptions = Ptr DPI_DeqOptions Source #

type PtrEnqOptions = Ptr DPI_EnqOptions Source #

type PtrMsgProps = Ptr DPI_MsgProps Source #

type PtrContext = Ptr DPI_Context Source #

newtype Data Source #

Constructors

Data (NativeTypeNum -> IO DataValue) 

Instances

Storable Data Source # 

Methods

sizeOf :: Data -> Int #

alignment :: Data -> Int #

peekElemOff :: Ptr Data -> Int -> IO Data #

pokeElemOff :: Ptr Data -> Int -> Data -> IO () #

peekByteOff :: Ptr b -> Int -> IO Data #

pokeByteOff :: Ptr b -> Int -> Data -> IO () #

peek :: Ptr Data -> IO Data #

poke :: Ptr Data -> Data -> IO () #