Portability | Portable (Cookbook |
---|---|
Stability | Stable |
Maintainer | nathanpisarski@gmail.com |
Safe Haskell | Safe-Inferred |
A library for reading simple databases. As what was originally a quirk of the library, database tables can be split up and still parsed as if they were a unit, giving it the ability to read the same table from multiple files in parallel. Quill supports a comment syntax, whitespace-insignificant parsing, and a full CRUD API. Quill will EVENTUALLY be replaced by Scribe2, but the planning for Scribe2 has not yet begun.
- data Table = Table {}
- prepare :: [String] -> String
- tokenize :: [a] -> [(a, a)]
- tblNames :: String -> [String]
- headlessData :: String -> [[String]]
- tokenLists :: [[String]] -> [[(String, String)]]
- tables :: [String] -> [(String, [(String, String)])]
- getTable :: [(String, [(String, String)])] -> String -> [(String, String)]
- lookUp :: [(String, [(String, String)])] -> (String, String) -> [String]
- createTable :: [(String, [(String, String)])] -> String -> [(String, [(String, String)])]
- removeTable :: [(String, [(String, String)])] -> String -> [(String, [(String, String)])]
- removeItem :: [(String, [(String, String)])] -> (String, String) -> [(String, [(String, String)])]
- addItem :: [(String, [(String, String)])] -> String -> (String, String) -> [(String, [(String, String)])]
- changeItem :: [(String, [(String, String)])] -> (String, String) -> String -> [(String, [(String, String)])]
- tableToString :: (String, [(String, String)]) -> String
Documentation
A table is a record of a name and the information within it.
prepare :: [String] -> StringSource
Sanitizes strings for Quill processing. Removes comments, newlines, and flattens it into a string.
headlessData :: String -> [[String]]Source
- Should not be used raw except for API programming. Really shouldn't be included, but too lazy to enumerate top-level declarations for selective export* Returns all entry lines from within tables in database.
tokenLists :: [[String]] -> [[(String, String)]]Source
Returns all of the tokens from headlessData.
tables :: [String] -> [(String, [(String, String)])]Source
Creates a listing of all tables in the file.
getTable :: [(String, [(String, String)])] -> String -> [(String, String)]Source
Gets a particular table in the file, returning its key-value pairs.
lookUp :: [(String, [(String, String)])] -> (String, String) -> [String]Source
Gets the particular item within a table from a database.
createTable :: [(String, [(String, String)])] -> String -> [(String, [(String, String)])]Source
Creates a new table within the database.
removeTable :: [(String, [(String, String)])] -> String -> [(String, [(String, String)])]Source
Removes an entire table from the database by name.
removeItem :: [(String, [(String, String)])] -> (String, String) -> [(String, [(String, String)])]Source
Removes a particular item from a table within a database.
addItem :: [(String, [(String, String)])] -> String -> (String, String) -> [(String, [(String, String)])]Source
Adds an item to a table within a database.