libdbm 0.1.4 copy "libdbm: ^0.1.4" to clipboard
libdbm: ^0.1.4 copied to clipboard

outdated

A tint and fast (1000s read/write per second) database with a simple API (`Map`) for Dart using disk-based hashing. No dependencies, batteries included.

example/example.dart

import 'dart:io';
import 'dart:convert' show utf8;
import 'package:libdbm/libdbm.dart';

void main() {
  final key = utf8.encode('A key');
  final value = utf8.encode('A value');

  final file = File('dummy.db');
  final db = HashDBM(file.openSync(mode: FileMode.write));
  db.put(key, value);
  var result = db.get(key);
  print('${utf8.decode(result)}');
  for (var i = db.entries(); i.moveNext();) {
    print('${utf8.decode(i.current.key)}');
    print('${utf8.decode(i.current.value)}');
  }
  db.remove(key);
  db.get(key); // will return null
  db.close();
  file.delete();
}
copied to clipboard
0
likes
0
points
42
downloads

Publisher

verified publisherlibdbm.com

Weekly Downloads

2024.08.27 - 2025.03.11

A tint and fast (1000s read/write per second) database with a simple API (`Map`) for Dart using disk-based hashing. No dependencies, batteries included.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on libdbm