• Home
Name Date Size #Lines LOC

..--

example/12-May-2024-5746

lib/12-May-2024-6,2772,678

test/12-May-2024-193155

.gitignoreD12-May-202411 11

.packagesD12-May-20244.7 KiB5554

CHANGELOG.mdD12-May-2024167 43

CMakeLists.txtD12-May-20243.3 KiB9275

LICENSED12-May-20241.1 KiB2117

README.mdD12-May-20241.2 KiB5034

analysis_options.yamlD12-May-20244.9 KiB158126

pubspec.yamlD12-May-2024432 1613

pubspec.yaml.inD12-May-2024446 1613

version.txtD12-May-202414 11

README.md

1# EJDB2 Dart VM native binding
2
3Embeddable JSON Database engine http://ejdb.org Dart binding.
4
5See https://github.com/Softmotions/ejdb/blob/master/README.md
6
7For API usage examples take a look into [/example](https://github.com/Softmotions/ejdb/tree/master/src/bindings/ejdb2_dart/example) and [/test](https://github.com/Softmotions/ejdb/tree/master/src/bindings/ejdb2_dart/test) folders.
8
9## Example
10
11```dart
12import 'package:ejdb2_dart/ejdb2_dart.dart';
13
14void main() async {
15  final db = await EJDB2.open('example.db', truncate: true);
16
17  var id = await db.put('parrots', {'name': 'Bianca', 'age': 4});
18  print('Bianca record: ${id}');
19
20  id = await db.put('parrots', {'name': 'Darko', 'age': 8});
21  print('Darko record: ${id}');
22
23  final q = db.createQuery('/[age > :age]', 'parrots');
24  await for (final doc in q.setInt('age', 3).execute()) {
25    print('Found ${doc}');
26  }
27  await db.close();
28}
29```
30
31## Supported platforms
32
33* Linux x64
34* OSX
35
36## How build it manually
37
38Note: native binding requires Dart SDK version >= 2.12.x
39
40``` sh
41git clone https://github.com/Softmotions/ejdb.git
42cd ./ejdb
43mkdir ./build && cd build
44cmake .. -DBUILD_DART_BINDING=ON -DCMAKE_BUILD_TYPE=Release
45make
46cd src/bindings/ejdb2_dart/ejdb2_dart
47pub get
48```
49
50