nesteggdb 0.0.3 copy "nesteggdb: ^0.0.3" to clipboard
nesteggdb: ^0.0.3 copied to clipboard

A lightweight file-based NoSQL database package for Flutter.

NestEggDB #

NestEggDB is a lightweight, file-based NoSQL database for Flutter, using Nest (database) and Egg (document/data entry). It supports transactions, queries, and ordered data storage.

Features #

  • Manage data with Nests (collections) and Eggs (entries).
  • Perform atomic transactions.
  • Filter and sort data with queries.
  • Preserve data order.
  • Handle hierarchical data with Sub-Eggs.

Installation #

Add to pubspec.yaml:

dependencies:
  egg_nest_db: ^0.0.3

Run:

flutter pub get

Usage #

import 'package:egg_nest_db/nest.dart';

// Initialize a Nest
final nest = Nest(path: '/path/to/database');
final collection = nest.eggCollection('myCollection');

// Add an Egg
collection.addEgg({'id': '1', 'name': 'First Egg', 'content': 'This is the first egg.'});

// Retrieve an Egg
final egg = collection.getEgg('1');
print('Egg content: ${egg?.data}');

// Update an Egg
collection.updateEgg('1', {'content': 'Updated content for the first egg.'});

// Delete an Egg
collection.deleteEgg('1');

// Perform a Transaction
nest.runTransaction((transaction) {
  transaction.add(collection, {'id': '2', 'name': 'Second Egg', 'content': 'This is the second egg.'});
});

// Query Data
final query = Query(collection).where('name', 'isEqualTo', 'First Egg').orderBy('id');
final results = query.get();
for (var result in results) {
  print(result);
}

// Get All Data with Sub-Eggs
print(collection.getAllData());
1
likes
130
points
33
downloads

Publisher

verified publishersyedawaisalishah.infinityfreeapp.com

Weekly Downloads

A lightweight file-based NoSQL database package for Flutter.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

crypto, flutter, path, path_provider

More

Packages that depend on nesteggdb