database 0.2.5 database: ^0.2.5 copied to clipboard
A vendor-agnostic database API. Various adapters are available, such as in-memory database, browser APIs, ElasticSearch, and others.
import 'package:database/database.dart';
void main() async {
// Choose a database
final database = MemoryDatabase();
// Search
final response = await database.collection('people').search(
query: Query.parse(
'"software developer" (dart OR javascript)',
take: 10,
),
);
// Print results
for (var snapshot in response.snapshots) {
print('Employee ID: ${snapshot.document.documentId}');
print('Employee name: ${snapshot.data['name']}');
print('');
}
}