Folio
const abstract class Folio : Obj
Folio database
Sub-class constructor
Logging for this database
Name of this database
Home directory for this database
Configuration used to init database
Read a list of records by ids into a grid
Backup APIs
Match all the records against a filter and return as list
Find the first record which matches the given filter
Convenience for commitAll with a single diff
Convenience for readByIds with single id
Return the number of records which match given filter
Commit a list of diffs to the database asynchronously
Match all the records against a filter and return as grid
Convenience for commitAllAsync with a single diff
Apply a list of diffs to the database in batch
Get storage for passwords and other secrets
Read a list of records by id
Close the database asynchronously and return future
Close the database synchronously (block until closed)
abstract FolioBackup backup()
Backup APIs
Void close(Duration? timeout)
Close the database synchronously (block until closed)
FolioFuture closeAsync()
Close the database asynchronously and return future
Diff commit(Diff diff)
Convenience for commitAll with a single diff.
Diff[] commitAll(Diff[] diffs)
Apply a list of diffs to the database in batch. Either all the changes are successfully applied, or else none of them are applied and an exception is raised. Return updated Diffs which encapsulate both the old and new version of each record.
If any of the records have been modified since they were read for the given change set then ConcurrentChangeErr is thrown unless Diff.force configured.
FolioFuture commitAllAsync(Diff[] diffs)
Commit a list of diffs to the database asynchronously.
FolioFuture commitAsync(Diff diff)
Convenience for commitAllAsync with a single diff.
const FolioConfig : config
Configuration used to init database
const File : dir
Home directory for this database
const Log : log
Logging for this database
new make(FolioConfig config)
Sub-class constructor
const Str : name
Name of this database
abstract PasswordStore passwords()
Get storage for passwords and other secrets
Dict? read(Filter filter, Bool checked)
Find the first record which matches the given filter. Throw UnknownRecErr or return null based on checked flag.
Grid readAll(Filter filter, Dict? opts)
Match all the records against a filter and return as grid.
Options:
- limit: max number of recs to read
- search: search string to apply in addition to filter
- sort: marker tag to sort recs by dis string
- trash: marker tag to include recs with trash tag
- gridMeta: Dict to use for grid meta
Dict[] readAllList(Filter filter, Dict? opts)
Match all the records against a filter and return as list. This method uses same semantics and options as readAll.
Dict? readById(Ref id, Bool checked)
Convenience for readByIds with single id.
Grid readByIds(Ref[] ids, Bool checked)
Read a list of records by ids into a grid. The rows in the result correspond by index to the ids list. If checked is true, then every id must be found in the project or UnknownRecErr is thrown. If checked is false, then an unknown record is returned as a row with every column set to null (including the id tag).
Dict?[] readByIdsList(Ref[] ids, Bool checked)
Read a list of records by id. The resulting list matches the list of ids by index (null if record not found).
Int readCount(Filter filter, Dict? opts)
Return the number of records which match given filter. This method supports the same options as readAll.