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

outdated

A lightweight, SQLite-based document store for Flutter. This package simplifies data storage and retrieval, allowing users to manage documents with key-value pairs and query data using filters, date r [...]

example/main.dart

import 'package:docdb/doc.dart';
import 'package:docdb/docdb.dart';

void main() async {
  // Initialize DocDB instance and connect to the database
  final db = DocDB();
  await db.connect(dbName: 'example.db');

  // Insert a document
  final doc = Doc();
  doc['title'] = 'Example Document';
  doc['content'] = 'This is an example document.';
  await db.insert(doc);

  // Retrieve the document
  Doc retrievedDoc = await db.get(doc.id);
  print('Retrieved document: ${retrievedDoc.toMap()}');

  // Update the document
  doc['title'] = 'Updated Example Document';
  await db.update(doc);

  // Retrieve the updated document
  final updatedDoc = await db.get(doc.id);
  print('Updated document: ${updatedDoc.toMap()}');

  // Delete the document
  await db.delete(doc.id);

  // Check if the document was deleted
  final deletedDoc = await db.get(doc.id);
  print('Deleted document: ${deletedDoc.toMap()}');
}
2
likes
130
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight, SQLite-based document store for Flutter. This package simplifies data storage and retrieval, allowing users to manage documents with key-value pairs and query data using filters, date ranges, and ordering. Ideal for small to medium-sized applications.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, path, sqflite, sqflite_common_ffi

More

Packages that depend on docdb