You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+17-3Lines changed: 17 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,28 @@
1
+
0.4.0 (2019-10-31)
2
+
------------------
3
+
* Flutter Android support
4
+
* Queries for all currently supported types
5
+
(thanks [Jasm Sison](https://github.com/Buggaboo) for [#27](https://github.com/objectbox/objectbox-dart/pull/27) and [#46](https://github.com/objectbox/objectbox-dart/pull/46)]
6
+
* More Box functions (count, isEmpty, contains, remove and their bulk variants)
7
+
(thanks [liquidiert](https://github.com/liquidiert) for [#42](https://github.com/objectbox/objectbox-dart/pull/42) and [#45](https://github.com/objectbox/objectbox-dart/pull/45)]
8
+
* Explicit write transactions
9
+
(thanks [liquidiert](https://github.com/liquidiert) for [#50](https://github.com/objectbox/objectbox-dart/pull/50)]
10
+
* Resolved linter issues
11
+
(thanks [Gregory Sech](https://github.com/GregorySech) for [#31](https://github.com/objectbox/objectbox-dart/pull/31)]
12
+
* Updated to objectbox-c 0.7.2
13
+
* First release on pub.dev
14
+
1
15
0.3.0 (2019-10-15)
2
16
------------------
3
17
* ID/UID generation and model persistence (objectbox-model.json)
4
18
* CI tests using GitHub Actions
5
19
* Code cleanup, refactoring and formatting
6
-
(thanks [Buggaboo](https://github.com/Buggaboo) for [#20](https://github.com/objectbox/objectbox-dart/pull/20) & [#21](https://github.com/objectbox/objectbox-dart/pull/21)]
20
+
(thanks [Jasm Sison](https://github.com/Buggaboo) for [#20](https://github.com/objectbox/objectbox-dart/pull/20) & [#21](https://github.com/objectbox/objectbox-dart/pull/21)]
7
21
8
22
0.2.0 (2019-09-11)
9
-
------------------
23
+
------------------Buggaboo
10
24
* UTF-8 support for Store and Box
11
-
(thanks to [Buggaboo](https://github.com/Buggaboo) for [#14](https://github.com/objectbox/objectbox-dart/pull/14)!)
25
+
(thanks to [Jasm Sison](https://github.com/Buggaboo) for [#14](https://github.com/objectbox/objectbox-dart/pull/14)!)
12
26
* Bulk put and get functions (getMany, getAll, putMany)
This project is completely managed on GitHub using its [issue tracker](https://github.com/objectbox/objectbox-dart/issues) and [project boards](https://github.com/objectbox/objectbox-dart/projects).
4
+
5
+
Anyone can contribute, be it by coding, improving docs or just proposing a new feature.
6
+
Look for tasks having a [**"help wanted"**](https://github.com/objectbox/objectbox-dart/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) tag.
7
+
When picking up an existing issue, please let us know in the issue comment.
8
+
Don't hesitate to reach out for guidance or to discuss a solution proposal!
9
+
10
+
### Code contributions
11
+
When creating a Pull Request for code changes, please check that you cover the following:
12
+
* Include tests for the changes you introduce. See the [test folder](test) for examples.
13
+
* Formatted the code using `dartfmt -l 120`. You can configure your IDE to do this automatically,
14
+
e.g. VS Code needs the project-specific settings `"editor.defaultFormatter": "Dart-Code.dart-code"` and `"dart.lineLength": 120`.
15
+
16
+
### Project workflow
17
+
Issues on the [project board](https://github.com/objectbox/objectbox-dart/projects/3) are referred to as "cards" which move from left to right:
18
+
19
+
* New cards start in the "To Do" column.
20
+
Within the column, cards are ordered: more important tasks should be above less important ones.
21
+
* Once somebody starts on a task, the according card is moved to "In progress".
22
+
Also, please assign yourself to the issue.
23
+
* Once a task is considered complete (e.g. PR is made), put it in the "Review" column.
24
+
* Once another person had a look and is happy, the task is finally moved to "Done" and its closed.
25
+
26
+
### Basic technical approach
27
+
ObjectBox offers a [C API](https://github.com/objectbox/objectbox-c) which can be called by [Dart FFI](https://dart.dev/server/c-interop).
28
+
The C API is is also used by the ObjectBox language bindings for [Go](https://github.com/objectbox/objectbox-go), [Swift](https://github.com/objectbox/objectbox-swift), and [Python](https://github.com/objectbox/objectbox-python).
29
+
These language bindings currently serve as an example for this Dart implementation.
30
+
Internally, ObjectBox uses [FlatBuffers](https://google.github.io/flatbuffers/) to store objects.
ObjectBox for Dart is a standalone database storing Dart objects locally, with strong ACID semantics.
4
4
5
-
Help wanted
6
-
-----------
7
-
ObjectBox for Dart is still in a prototype stage supporting only the most basic database tasks, like putting and getting objects.
8
-
However, the ObjectBox core supports many more features, e.g. queries, indexing, async operations, transaction control.
9
-
To bring all these features to Dart, we're asking the community to help out. PRs are more than welcome!
10
-
The ObjectBox team will try its best to guide you and answer questions.
11
-
12
-
Contributing
13
-
------------------
14
-
This project is completely managed here on GitHub using its [issue tracker](https://github.com/objectbox/objectbox-dart/issues) and [project boards](https://github.com/objectbox/objectbox-dart/projects).
15
-
16
-
To prepare an upcoming version, we create a (Kanban like) board for it.
17
-
Once it is decided which features and fixes go into the version, the according issues are added to the board.
18
-
Issues on the board are referred to as "cards" which move from left to right:
19
-
20
-
* New cards start in the "To Do" column.
21
-
Within the column, cards are ordered: more important tasks should be above less important ones.
22
-
* Once somebody starts on a task, the according card is moved to "In progress".
23
-
Also, please assign yourself to the issue.
24
-
* Once a task is considered complete (e.g. PR is made), put it in the "Review" column.
25
-
* Once another person had a look and is happy, the task is finally moved to "Done"
26
-
27
-
Anyone can contribute, be it by coding, improving docs or just proposing a new feature.
28
-
Look for tasks having a **"help wanted"** tag.
29
-
30
-
#### Feedback
31
-
Also, please let us know your feedback by opening an issue:
32
-
for example, if you experience errors or if you have ideas for how to improve the API.
33
-
Thanks!
5
+
Installation
6
+
------------
7
+
Add the following dependencies to your `pubspec.yaml`:
8
+
```yaml
9
+
dependencies:
10
+
objectbox: ^0.4.0
11
+
12
+
dev_dependencies:
13
+
build_runner: ^1.0.0
14
+
objectbox_generator: ^0.4.0
15
+
```
34
16
35
-
#### Code style
36
-
Please make sure that all code submitted via Pull Request is formatted using `dartfmt -l 120`.
37
-
You can configure your IDE to do this automatically, e.g. VS Code needs the project-specific settings
38
-
`"editor.defaultFormatter": "Dart-Code.dart-code"` and `"dart.lineLength": 120`.
17
+
Proceed based on whether you're developing a Flutter app or a standalone dart program:
18
+
1. **Flutter** only steps:
19
+
* Install the packages `flutter pub get`
20
+
* Add `objectbox-android` dependency to your `android/app/build.gradle`
* macOS/Linux: `bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-c/master/download.sh) 0.7` (answer Y when it asks about installing to /usr/lib).
46
-
* Windows:
47
-
* use "Git Bash" or similar to execute `bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-c/master/download.sh) 0.7`
48
-
* copy the downloaded `lib/objectbox.dll` to `C:\Windows\System32\` (requires admin privileges)
49
-
2. Back in this repository, run `pub get`.
50
-
3. Execute `pub run build_runner build`. This regenerates the ObjectBox model to make it usable in Dart
51
-
(i.e. the file `test/test.g.dart`) and is necessary each time you add or change a class annotated with `@Entity(...)`.
52
-
4. Finally run `pub run test` to run the unit tests.
53
-
54
-
Dart integration
55
49
----------------
56
50
In general, Dart class annotations are used to mark classes as ObjectBox entities and provide meta information.
57
51
Note that right now, only a limited set of types is supported; this will be expanded upon in the near future.
ObjectBox offers a [C API](https://github.com/objectbox/objectbox-c) which can be called by [Dart FFI](https://dart.dev/server/c-interop).
104
-
The C API is is also used by the ObjectBox language bindings for [Go](https://github.com/objectbox/objectbox-go), [Swift](https://github.com/objectbox/objectbox-swift), and [Python](https://github.com/objectbox/objectbox-python).
105
-
These language bindings currently serve as an example for this Dart implementation.
95
+
### Query and QueryBuilder
96
+
97
+
Basic querying can be done with e.g.:
98
+
99
+
```dart
100
+
// var store ...
101
+
// var box ...
102
+
103
+
box.putMany([Note(), Note(), Note()]);
104
+
box.put(Note.construct("Hello world!"));
105
+
106
+
final queryNullText = box.query(Note_.text.isNull()).build();
107
+
108
+
assert(queryNullText.count() == 3);
109
+
110
+
queryNullText.close(); // We have to manually close queries and query builders.
111
+
```
112
+
113
+
More complex queries can be constructed using `and/or` operators.
114
+
Also there is basic operator overloading support for `equal`, `greater`, `less`, `and` and `or`,
115
+
respectively `==`, `>`, `<`, `&`, `|`.
116
+
117
+
```dart
118
+
// final box ...
106
119
107
-
Internally, ObjectBox uses [FlatBuffers](https://google.github.io/flatbuffers/) to store objects.
108
-
There are two basic ways to make the conversion: generated binding code, or implicit FlatBuffers conversion.
109
-
The latter is used at the moment (helped us to get started quickly).
110
-
A future version will exchange that with code generation.
0 commit comments