Nitrite class abstract
Nitrite is a lightweight, embedded, and self-contained NoSQL database. It provides an easy-to-use API to store and retrieve data. Nitrite stores data in the form of documents and supports indexing on fields within the documents to provide efficient search capabilities. Nitrite supports transactions, and provides a simple and efficient way to persist data.
Nitrite is designed to be embedded within the application and does not require any external setup or installation.
Constructors
Properties
- config → NitriteConfig
-
Gets the NitriteConfig instance to configure the database.
no setter
-
databaseMetaData
→ Future<
StoreMetaData> -
Returns the metadata of the database store.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
hasUnsavedChanges
→ Future<
bool> -
Checks if there are any unsaved changes in the Nitrite database.
no setter
- isClosed → bool
-
Checks if the Nitrite database instance is closed.
no setter
-
listCollectionNames
→ Future<
Set< String> > -
Gets the set of all NitriteCollections' names saved in the store.
no setter
-
listKeyedRepositories
→ Future<
Map< String, Set< >String> > -
Gets the map of all key to the class names corresponding
to all keyed-ObjectRepositorys in the store.
no setter
-
listRepositories
→ Future<
Set< String> > -
Gets the set of all class names corresponding to all ObjectRepositorys
in the store.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
checkOpened(
) → void - Checks if the Nitrite database is opened or not. Throws NitriteIOException if the database is closed.
-
close(
) → Future< void> - Closes the database.
-
commit(
) → Future< void> - Commits the unsaved changes. For file based store, it saves the changes to disk if there are any unsaved changes.
-
createSession(
) → Session - Creates a new session for the Nitrite database. A session is a lightweight container that holds transactions. Multiple sessions can be created for a single Nitrite database instance.
-
destroyCollection(
String name) → Future< void> - Destroys a NitriteCollection without opening it first.
-
destroyRepository<
T> ({EntityDecorator< T> ? entityDecorator, String? key}) → Future<void> - Destroys an ObjectRepository without opening it first.
-
getCollection(
String name) → Future< NitriteCollection> - Opens a named collection from the store. If the collections does not exist it will be created automatically and returned. If a collection is already opened, it is returned as is.
-
getRepository<
T> ({EntityDecorator< T> ? entityDecorator, String? key}) → Future<ObjectRepository< T> > - Opens a type-safe object repository with an optional key identifier from the store. If the repository does not exist it will be created automatically and returned. If a repository is already opened, it is returned as is.
-
getStore<
T extends StoreConfig> () → NitriteStore< T> - Gets the NitriteStore instance associated with this Nitrite database.
-
hasCollection(
String name) → Future< bool> - Checks if a collection with the given name exists in the database.
-
hasRepository<
T> ({EntityDecorator< T> ? entityDecorator, String? key}) → Future<bool> - Checks if a repository of the specified type and key exists in the database.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validateCollectionName(
String name) → void - Validates the given collection name. Throws ValidationException if the name is invalid.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
builder(
) → NitriteBuilder - Returns a new instance of NitriteBuilder to build a new Nitrite database instance.