-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Simple library for database access from Haskell.
--
-- Simple library for database access from Haskell.
@package hsql
@version 1.7.1
module Database.HSQL.Types
type FieldDef = (String, SqlType, Bool)
data SqlType
SqlChar :: Int -> SqlType
SqlVarChar :: Int -> SqlType
SqlLongVarChar :: Int -> SqlType
SqlText :: SqlType
SqlWChar :: Int -> SqlType
SqlWVarChar :: Int -> SqlType
SqlWLongVarChar :: Int -> SqlType
SqlDecimal :: Int -> Int -> SqlType
SqlNumeric :: Int -> Int -> SqlType
SqlSmallInt :: SqlType
SqlMedInt :: SqlType
SqlInteger :: SqlType
SqlReal :: SqlType
SqlFloat :: SqlType
SqlDouble :: SqlType
SqlBit :: SqlType
SqlTinyInt :: SqlType
SqlBigInt :: SqlType
SqlBinary :: Int -> SqlType
SqlVarBinary :: Int -> SqlType
SqlLongVarBinary :: Int -> SqlType
SqlDate :: SqlType
SqlTime :: SqlType
SqlTimeTZ :: SqlType
SqlAbsTime :: SqlType
SqlRelTime :: SqlType
SqlTimeInterval :: SqlType
SqlAbsTimeInterval :: SqlType
SqlTimeStamp :: SqlType
SqlDateTime :: SqlType
SqlDateTimeTZ :: SqlType
SqlYear :: SqlType
SqlSET :: SqlType
SqlENUM :: SqlType
SqlBLOB :: SqlType
SqlMoney :: SqlType
SqlINetAddr :: SqlType
SqlCIDRAddr :: SqlType
SqlMacAddr :: SqlType
SqlPoint :: SqlType
SqlLSeg :: SqlType
SqlPath :: SqlType
SqlBox :: SqlType
SqlPolygon :: SqlType
SqlLine :: SqlType
SqlCircle :: SqlType
-- | HSQL returns SqlUnknown tp for all columns for which it
-- cannot determine the right type. The tp here is the internal
-- type code returned from the backend library
SqlUnknown :: Int -> SqlType
data SqlError
SqlError :: String -> Int -> String -> SqlError
seState :: SqlError -> String
seNativeError :: SqlError -> Int
seErrorMsg :: SqlError -> String
SqlNoData :: SqlError
SqlInvalidHandle :: SqlError
SqlStillExecuting :: SqlError
SqlNeedData :: SqlError
SqlBadTypeCast :: String -> SqlType -> SqlError
seFieldName :: SqlError -> String
seFieldType :: SqlError -> SqlType
SqlFetchNull :: String -> SqlError
seFieldName :: SqlError -> String
SqlUnknownField :: String -> SqlError
seFieldName :: SqlError -> String
SqlUnsupportedOperation :: SqlError
SqlClosedHandle :: SqlError
sqlErrorTc :: TyCon
-- | A Connection type represents a connection to a database,
-- through which you can operate on the it. In order to create the
-- connection you need to use the connect function from the
-- module for your prefered backend.
data Connection
Connection :: IO () -> (String -> IO ()) -> (String -> IO Statement) -> IO [String] -> (String -> IO [FieldDef]) -> IO () -> IO () -> IO () -> MVar Bool -> Connection
connDisconnect :: Connection -> IO ()
connExecute :: Connection -> String -> IO ()
connQuery :: Connection -> String -> IO Statement
connTables :: Connection -> IO [String]
connDescribe :: Connection -> String -> IO [FieldDef]
connBeginTransaction :: Connection -> IO ()
connCommitTransaction :: Connection -> IO ()
connRollbackTransaction :: Connection -> IO ()
connClosed :: Connection -> MVar Bool
-- | The Statement type represents a result from the execution of
-- given SQL query.
data Statement
Statement :: Connection -> IO () -> IO Bool -> (forall a. Int -> FieldDef -> (FieldDef -> CString -> Int -> IO a) -> IO a) -> [FieldDef] -> MVar Bool -> Statement
stmtConn :: Statement -> Connection
stmtClose :: Statement -> IO ()
stmtFetch :: Statement -> IO Bool
stmtGetCol :: Statement -> forall a. Int -> FieldDef -> (FieldDef -> CString -> Int -> IO a) -> IO a
stmtFields :: Statement -> [FieldDef]
stmtClosed :: Statement -> MVar Bool
class SqlBind a
fromSqlCStringLen :: (SqlBind a) => FieldDef -> CString -> Int -> IO a
fromSqlValue :: (SqlBind a) => SqlType -> String -> Maybe a
toSqlValue :: (SqlBind a) => a -> String
instance Typeable SqlError
instance Eq SqlType
instance Show SqlType
instance Show SqlError
module Database.HSQL
-- | A Connection type represents a connection to a database,
-- through which you can operate on the it. In order to create the
-- connection you need to use the connect function from the
-- module for your prefered backend.
data Connection
-- | Closes the connection. Performing disconnect on a connection
-- that has already been closed has no effect. All other operations on a
-- closed connection will fail.
disconnect :: Connection -> IO ()
-- | Submits a command to the database.
execute :: Connection -> String -> IO ()
-- | The Statement type represents a result from the execution of
-- given SQL query.
data Statement
-- | Executes a query and returns a result set
query :: Connection -> String -> IO Statement
-- | closeStatement stops processing associated with a specific
-- statement, closes any open cursors associated with the statement,
-- discards pending results, and frees all resources associated with the
-- statement. Performing closeStatement on a statement that has
-- already been closed has no effect. All other operations on a closed
-- statement will fail.
closeStatement :: Statement -> IO ()
-- | fetch fetches the next rowset of data from the result set. The
-- values from columns can be retrieved with getFieldValue
-- function.
fetch :: Statement -> IO Bool
type FieldDef = (String, SqlType, Bool)
data SqlType
SqlChar :: Int -> SqlType
SqlVarChar :: Int -> SqlType
SqlLongVarChar :: Int -> SqlType
SqlText :: SqlType
SqlWChar :: Int -> SqlType
SqlWVarChar :: Int -> SqlType
SqlWLongVarChar :: Int -> SqlType
SqlDecimal :: Int -> Int -> SqlType
SqlNumeric :: Int -> Int -> SqlType
SqlSmallInt :: SqlType
SqlMedInt :: SqlType
SqlInteger :: SqlType
SqlReal :: SqlType
SqlFloat :: SqlType
SqlDouble :: SqlType
SqlBit :: SqlType
SqlTinyInt :: SqlType
SqlBigInt :: SqlType
SqlBinary :: Int -> SqlType
SqlVarBinary :: Int -> SqlType
SqlLongVarBinary :: Int -> SqlType
SqlDate :: SqlType
SqlTime :: SqlType
SqlTimeTZ :: SqlType
SqlAbsTime :: SqlType
SqlRelTime :: SqlType
SqlTimeInterval :: SqlType
SqlAbsTimeInterval :: SqlType
SqlTimeStamp :: SqlType
SqlDateTime :: SqlType
SqlDateTimeTZ :: SqlType
SqlYear :: SqlType
SqlSET :: SqlType
SqlENUM :: SqlType
SqlBLOB :: SqlType
SqlMoney :: SqlType
SqlINetAddr :: SqlType
SqlCIDRAddr :: SqlType
SqlMacAddr :: SqlType
SqlPoint :: SqlType
SqlLSeg :: SqlType
SqlPath :: SqlType
SqlBox :: SqlType
SqlPolygon :: SqlType
SqlLine :: SqlType
SqlCircle :: SqlType
-- | HSQL returns SqlUnknown tp for all columns for which it
-- cannot determine the right type. The tp here is the internal
-- type code returned from the backend library
SqlUnknown :: Int -> SqlType
class SqlBind a
fromSqlCStringLen :: (SqlBind a) => FieldDef -> CString -> Int -> IO a
fromSqlValue :: (SqlBind a) => SqlType -> String -> Maybe a
toSqlValue :: (SqlBind a) => a -> String
-- | Retrieves the value of field with the specified name.
getFieldValue :: (SqlBind a) => Statement -> String -> IO a
getFieldValueMB :: (SqlBind a) => Statement -> String -> IO (Maybe a)
-- | Retrieves the value of field with the specified name. If the field
-- value is null then the function will return the default
-- value.
getFieldValue' :: (SqlBind a) => Statement -> String -> a -> IO a
-- | Returns the type and the nullable flag for field with
-- specified name
getFieldValueType :: Statement -> String -> (SqlType, Bool)
-- | Returns the list of fields with their types and nullable
-- flags
getFieldsTypes :: Statement -> [(String, SqlType, Bool)]
-- | The inTransaction function executes the specified action in
-- transaction mode. If the action completes successfully then the
-- transaction will be commited. If the action completes with an
-- exception then the transaction will be rolled back and the exception
-- will be throw again.
inTransaction :: Connection -> (Connection -> IO a) -> IO a
data SqlError
SqlError :: String -> Int -> String -> SqlError
seState :: SqlError -> String
seNativeError :: SqlError -> Int
seErrorMsg :: SqlError -> String
SqlNoData :: SqlError
SqlInvalidHandle :: SqlError
SqlStillExecuting :: SqlError
SqlNeedData :: SqlError
SqlBadTypeCast :: String -> SqlType -> SqlError
seFieldName :: SqlError -> String
seFieldType :: SqlError -> SqlType
SqlFetchNull :: String -> SqlError
seFieldName :: SqlError -> String
SqlUnknownField :: String -> SqlError
seFieldName :: SqlError -> String
SqlUnsupportedOperation :: SqlError
SqlClosedHandle :: SqlError
catchSql :: IO a -> (SqlError -> IO a) -> IO a
handleSql :: (SqlError -> IO a) -> IO a -> IO a
sqlExceptions :: Exception -> Maybe SqlError
-- | The forEachRow function iterates through the result set in
-- Statement and executes the given action for each row in the
-- set. The function closes the Statement after the last row
-- processing or if the given action raises an exception.
forEachRow :: (Statement -> s -> IO s) -> Statement -> s -> IO s
-- | The 'forEachRow\'' function is analogous to forEachRow but
-- doesn't provide state. The function closes the Statement after
-- the last row processing or if the given action raises an exception.
forEachRow' :: (Statement -> IO ()) -> Statement -> IO ()
-- | The collectRows function iterates through the result set in
-- Statement and executes the given action for each row in the
-- set. The values returned from action are collected and returned as
-- list. The function closes the Statement after the last row
-- processing or if the given action raises an exception.
collectRows :: (Statement -> IO a) -> Statement -> IO [a]
-- | List all tables in the database.
tables :: Connection -> IO [String]
-- | List all columns in a table along with their types and
-- nullable flags
describe :: Connection -> String -> IO [FieldDef]
data Point
Point :: Double -> Double -> Point
data Line
Line :: Point -> Point -> Line
data Path
OpenPath :: [Point] -> Path
ClosedPath :: [Point] -> Path
data Box
Box :: Double -> Double -> Double -> Double -> Box
data Circle
Circle :: Point -> Double -> Circle
data Polygon
Polygon :: [Point] -> Polygon
instance Eq MacAddr
instance Show MacAddr
instance Eq INetAddr
instance Show INetAddr
instance Eq Polygon
instance Show Polygon
instance Eq Circle
instance Show Circle
instance Eq Box
instance Show Box
instance Eq Path
instance Show Path
instance Eq Line
instance Show Line
instance Eq Point
instance Show Point
instance SqlBind MacAddr
instance SqlBind INetAddr
instance SqlBind Circle
instance SqlBind Polygon
instance SqlBind Box
instance SqlBind Path
instance SqlBind Line
instance SqlBind Point
instance SqlBind ClockTime
instance SqlBind Float
instance SqlBind Double
instance SqlBind Bool
instance SqlBind String
instance SqlBind Integer
instance SqlBind Int64
instance SqlBind Int
instance (SqlBind a) => SqlBind (Maybe a)