Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- collectAllErrorsAsText :: [Either Text b] -> Either Text [b]
- collectErrorList :: [Either e b] -> Either [e] [b]
- colToFileUrl :: Text -> Text -> Text -> Text -> Text
- escDoubleQuotes :: Text -> Text
- escSingleQuotes :: Text -> Text
- getDbDir :: Text -> FilePath
- getGraphiQLVersion :: IO Text
- getMainDbPath :: Text -> FilePath
- getOrderOfLinkedList :: [(Text, Maybe Text)] -> [Text]
- getReadOnlyFilePath :: Text -> FilePath
- getDbIdFromReadOnlyId :: Text -> IO (Maybe Text)
- getSqliteBinaryVersion :: ExternalAppContext -> IO Text
- getSqliteEmbeddedVersion :: Connection -> IO Text
- headerJsonContent :: [(HeaderName, ByteString)]
- mainServerDb :: FilePath
- quoteKeyword :: Text -> Text
- quoteText :: Text -> Text
- removeIfExists :: FilePath -> IO ()
- runSqliteCommand :: ExternalAppContext -> FilePath -> ByteString -> Handler Text
- throwErr400WithMsg :: Text -> Handler a
- throwErr404WithMsg :: Text -> Handler a
- throwErr500WithMsg :: Text -> Handler a
- withRetryConn :: FilePath -> (Connection -> IO a) -> IO a
- data DiffKind
Documentation
collectAllErrorsAsText :: [Either Text b] -> Either Text [b] Source #
Similar to sequence
, except it doesn't stop on the first error.
What differentiates this from collectErrorList
is
that it also merges the errors into a single error message.
collectErrorList :: [Either e b] -> Either [e] [b] Source #
Similar to sequence
, except it doesn't stop on the first error.
escDoubleQuotes :: Text -> Text Source #
Escape double quotes in SQL strings
escSingleQuotes :: Text -> Text Source #
Escape single quotes in SQL strings
getMainDbPath :: Text -> FilePath Source #
getOrderOfLinkedList :: [(Text, Maybe Text)] -> [Text] Source #
Get the order of a linked list.
| Each tuple is `(name, previous name in list)`.
| The first's element previous name is Nothing
.
| Tries to find the longest chain of elements if no start element is found.
| It's quite complicated to also handle incomplete orderings correctly.
getReadOnlyFilePath :: Text -> FilePath Source #
headerJsonContent :: [(HeaderName, ByteString)] Source #
quoteKeyword :: Text -> Text Source #
Quote a keyword in an SQL query
removeIfExists :: FilePath -> IO () Source #
runSqliteCommand :: ExternalAppContext -> FilePath -> ByteString -> Handler Text Source #
throwErr400WithMsg :: Text -> Handler a Source #
Throw an "400 Bad Request" error with a message
throwErr404WithMsg :: Text -> Handler a Source #
Throw an "404 Not Found" error with a message
throwErr500WithMsg :: Text -> Handler a Source #
Throw an "500 Internal Server Error" error with a message
withRetryConn :: FilePath -> (Connection -> IO a) -> IO a Source #
Run an action with a connection, retrying if the database is busy. | Necessary because of WAL mode: | https://sqlite.org/wal.html#sometimes_queries_return_sqlite_busy_in_wal_mode