Database QML Type
Database implements on-disk storage for documents and indexes. More...
Import Statement: | import U1db 1.0 |
Properties
Methods
Detailed Description
In a ListView the Database can be used as a model which includes all documents in the database. For listing only a subset of documents Query can be used.
ListView { model: Database { id: myDatabase } delegate: ListItem.Subtitled { text: docId subText: contents.color } }
See also Query.
Property Documentation
A relative path can be given to store the database in an app-specific writable folder. This is recommended as it ensures to work with confinement. If more control is needed absolute paths or local file URIs can be used. By default or if the path is empty everything is stored in memory.
Method Documentation
Returns the contents of a document by docId in a form that QML recognizes as a Variant object, it's identical to Document::getContents() with the same docId.
Updates the existing contents of the document identified by docId if there's no error. If no docId is given or docId is an empty string the contents will be stored under an autogenerated name. Returns the new revision of the document, or -1 on failure.