Skip to content

Commit 7798b7c

Browse files
Merge branch '76-export-query-property-classes' into 'main'
Show QueryProperty classes, docs fixes See merge request objectbox/objectbox-dart!52
2 parents 518110b + ba42a0d commit 7798b7c

File tree

9 files changed

+25
-27
lines changed

9 files changed

+25
-27
lines changed

objectbox/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
ObjectBox library on these devices. [#369](https://github.com/objectbox/objectbox-dart/issues/369)
66
* Improve code generator performance if there are many entities with many constructor parameters.
77
* Throw `StateError` instead of crashing on closed `Box`, `Query` and `PropertyQuery`.
8+
* Export query property classes to make them usable in user code.
89

910
## 2.1.0 (2023-06-13)
1011

objectbox/lib/internal.dart

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,9 @@
22
/// Don't import into your own code, use 'objectbox.dart' instead.
33
library objectbox_internal;
44

5-
// ignore_for_file: invalid_export_of_internal_element
6-
7-
export 'src/model.dart';
85
export 'src/modelinfo/index.dart';
96
export 'src/native/bindings/flatbuffers_readers.dart';
107
export 'src/native/store.dart' show InternalStoreAccess;
11-
export 'src/query.dart'
12-
// don't export the same things as objectbox.dart to avoid docs conflicts
13-
hide
14-
Query,
15-
QueryBuilder,
16-
Order,
17-
Condition,
18-
PropertyQuery,
19-
IntegerPropertyQuery,
20-
DoublePropertyQuery,
21-
StringPropertyQuery;
228
export 'src/relations/info.dart';
239
export 'src/relations/to_many.dart'
2410
show InternalToManyAccess, InternalToManyTestAccess;

objectbox/lib/objectbox.dart

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,18 @@ export 'src/query.dart'
2323
QueryParamBytes,
2424
QueryParamInt,
2525
QueryParamBool,
26-
QueryParamDouble;
26+
QueryParamDouble,
27+
QueryProperty,
28+
QueryStringProperty,
29+
QueryByteVectorProperty,
30+
QueryIntegerProperty,
31+
QueryIntegerVectorProperty,
32+
QueryDoubleProperty,
33+
QueryDoubleVectorProperty,
34+
QueryBooleanProperty,
35+
QueryStringVectorProperty,
36+
QueryRelationToOne,
37+
QueryRelationToMany;
2738
export 'src/relations/to_many.dart' show ToMany;
2839
export 'src/relations/to_one.dart' show ToOne;
2940
export 'src/store.dart' show Store, ObservableStore;

objectbox/lib/src/native/box.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,12 @@ class Box<T> {
360360
/// to be spawned.
361361
Future<T?> getAsync(int id) => _store.runAsync(_getAsyncCallback<T>, id);
362362

363-
/// Returns a list of [ids.length] Objects of type T, each corresponding to
364-
/// the location of its ID in [ids]. Non-existent IDs become null.
363+
/// Returns a list of Objects of type T, each located at the corresponding
364+
/// position of its ID in [ids].
365365
///
366-
/// Pass growableResult: true for the resulting list to be growable.
366+
/// If an object does not exist, null is added to the list instead.
367+
///
368+
/// Set [growableResult] to `true` for the returned list to be growable.
367369
List<T?> getMany(List<int> ids, {bool growableResult = false}) {
368370
final result = List<T?>.filled(ids.length, null, growable: growableResult);
369371
if (ids.isEmpty) return result;

objectbox/lib/src/native/query/property.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ extension IntegerPropertyQuery on PropertyQuery<int> {
105105

106106
/// Set to only return distinct values.
107107
///
108-
/// E.g. [1,2,3] instead of [1,1,2,3,3,3].
108+
/// E.g. `[1,2,3]` instead of `[1,1,2,3,3,3]`.
109109
/// Strings default to case-insensitive comparison.
110110
set distinct(bool d) {
111111
_distinct = d;
@@ -201,7 +201,7 @@ extension DoublePropertyQuery on PropertyQuery<double> {
201201

202202
/// Set to only return distinct values.
203203
///
204-
/// E.g. [1,2,3] instead of [1,1,2,3,3,3].
204+
/// E.g. `[1,2,3]` instead of `[1,1,2,3,3,3]`.
205205
/// Strings default to case-insensitive comparison.
206206
set distinct(bool d) {
207207
_distinct = d;
@@ -267,7 +267,7 @@ extension StringPropertyQuery on PropertyQuery<String> {
267267

268268
/// Set to only return distinct values.
269269
///
270-
/// E.g. [foo, bar] instead of [foo, bar, bar, bar, foo].
270+
/// E.g. `[foo, bar]` instead of `[foo, bar, bar, bar, foo]`.
271271
/// Strings default to case-insensitive comparison.
272272
set distinct(bool d) {
273273
_distinct = d;

objectbox/lib/src/native/query/query.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Order {
3737
static final caseSensitive = 2;
3838

3939
/// For integers only: changes the comparison to unsigned. The default is
40-
/// signed, unless the property is annotated with [@Property(signed: false)].
40+
/// signed, unless the property is annotated with `@Property(signed: false)`.
4141
static final unsigned = 4;
4242

4343
/// null values will be put last.

objectbox/lib/src/native/store.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Store implements Finalizable {
7373

7474
late final ByteData _reference;
7575

76-
/// A list of observers of the Store.close() event.
76+
/// A list of observers of the [Store.close] event.
7777
final _onClose = <dynamic, void Function()>{};
7878

7979
/// If true and calling [close] will also close the native Store and
@@ -846,12 +846,12 @@ class InternalStoreAccess {
846846
return store._entityTypeById!;
847847
}
848848

849-
/// Adds a listener to the [store.close()] event.
849+
/// Adds a listener to the [Store.close] event.
850850
static void addCloseListener(
851851
Store store, dynamic key, void Function() listener) =>
852852
store._onClose[key] = listener;
853853

854-
/// Removes a [store.close()] event listener.
854+
/// Removes a [Store.close] event listener.
855855
static void removeCloseListener(Store store, dynamic key) =>
856856
store._onClose.remove(key);
857857

objectbox/lib/src/relations/to_many.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ class InternalToManyAccess {
303303
}
304304

305305
/// Internal only.
306-
@internal
307306
@visibleForTesting
308307
class InternalToManyTestAccess<EntityT> {
309308
final ToMany<EntityT> _rel;

objectbox_test/test/query_property_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'dart:math';
22

3-
import 'package:objectbox/internal.dart';
43
import 'package:test/test.dart';
54

65
import 'entity.dart';

0 commit comments

Comments
 (0)