database 0.3.0 database: ^0.3.0 copied to clipboard
Enables Flutter/Dart developers use many databases. For example, SQLite, Web Storage API, Google Cloud Firestore, PostgreSQL, ElasticSearch, Algolia.
import 'package:database/database.dart';
void main() async {
// Choose a database
final database = MemoryDatabaseAdapter().database();
// 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('');
}
}