-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Backend for the persistent library using sqlite3.
--
-- This package includes a thin sqlite3 wrapper based on the
-- direct-sqlite package, as well as the entire C library, so there are
-- no system dependencies.
@package persistent-sqlite
@version 2.1.3
-- | A port of the direct-sqlite package for dealing directly with
-- PersistValues.
module Database.Sqlite
data Connection
data Statement
data Error
ErrorOK :: Error
ErrorError :: Error
ErrorInternal :: Error
ErrorPermission :: Error
ErrorAbort :: Error
ErrorBusy :: Error
ErrorLocked :: Error
ErrorNoMemory :: Error
ErrorReadOnly :: Error
ErrorInterrupt :: Error
ErrorIO :: Error
ErrorNotFound :: Error
ErrorCorrupt :: Error
ErrorFull :: Error
ErrorCan'tOpen :: Error
ErrorProtocol :: Error
ErrorEmpty :: Error
ErrorSchema :: Error
ErrorTooBig :: Error
ErrorConstraint :: Error
ErrorMismatch :: Error
ErrorMisuse :: Error
ErrorNoLargeFileSupport :: Error
ErrorAuthorization :: Error
ErrorFormat :: Error
ErrorRange :: Error
ErrorNotAConnection :: Error
ErrorRow :: Error
ErrorDone :: Error
-- | A custom exception type to make it easier to catch exceptions.
--
-- Since 2.1.3
data SqliteException
SqliteException :: !Error -> !Text -> !Text -> SqliteException
seError :: SqliteException -> !Error
seFunctionName :: SqliteException -> !Text
seDetails :: SqliteException -> !Text
data StepResult
Row :: StepResult
Done :: StepResult
open :: Text -> IO Connection
close :: Connection -> IO ()
prepare :: Connection -> Text -> IO Statement
step :: Statement -> IO StepResult
reset :: Connection -> Statement -> IO ()
finalize :: Statement -> IO ()
bindBlob :: Statement -> Int -> ByteString -> IO ()
bindDouble :: Statement -> Int -> Double -> IO ()
bindInt :: Statement -> Int -> Int -> IO ()
bindInt64 :: Statement -> Int -> Int64 -> IO ()
bindNull :: Statement -> Int -> IO ()
bindText :: Statement -> Int -> Text -> IO ()
bind :: Statement -> [PersistValue] -> IO ()
column :: Statement -> Int -> IO PersistValue
columns :: Statement -> IO [PersistValue]
changes :: Connection -> IO Int64
instance Typeable SqliteException
instance Eq Error
instance Show Error
instance Eq StepResult
instance Show StepResult
instance Eq ColumnType
instance Show ColumnType
instance Exception SqliteException
instance Show SqliteException
-- | A sqlite backend for persistent.
--
-- Note: If you prepend WAL=off to your connection string, it
-- will disable the write-ahead log. For more information, see
-- https://github.com/yesodweb/persistent/issues/363.
module Database.Persist.Sqlite
withSqlitePool :: (MonadBaseControl IO m, MonadIO m, MonadLogger m) => Text -> Int -> (ConnectionPool -> m a) -> m a
withSqliteConn :: (MonadBaseControl IO m, MonadIO m, MonadLogger m) => Text -> (SqlBackend -> m a) -> m a
createSqlitePool :: (MonadIO m, MonadLogger m, MonadBaseControl IO m) => Text -> Int -> m ConnectionPool
-- | Information required to connect to a sqlite database
data SqliteConf
SqliteConf :: Text -> Int -> SqliteConf
sqlDatabase :: SqliteConf -> Text
sqlPoolSize :: SqliteConf -> Int
-- | A convenience helper which creates a new database connection and runs
-- the given block, handling MonadResource and
-- MonadLogger requirements. Note that all log messages are
-- discarded.
--
-- Since 1.1.4
runSqlite :: (MonadBaseControl IO m, MonadIO m) => Text -> SqlPersistT (NoLoggingT (ResourceT m)) a -> m a
-- | Wrap up a raw Connection as a Persistent SQL Connection.
--
-- Since 1.1.5
wrapConnection :: Connection -> LogFunc -> IO SqlBackend
instance Show SqliteConf
instance PersistConfig SqliteConf
instance FromJSON SqliteConf