Skip to content

Commit 1511467

Browse files
committed
v0.0.1+2
1 parent 81c7d64 commit 1511467

File tree

4 files changed

+24
-19
lines changed

4 files changed

+24
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 0.0.1+1
1+
## 0.0.1+2
22

33
- Provided driver manager which can be used to register drivers and get a driver by its legal url
44

lib/src/types.dart

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ abstract class MetaKey {
1616

1717
enum GdbTypes {
1818
// types in graph database
19-
line,
20-
point,
21-
polygon,
19+
none,
2220
node,
23-
tag,
24-
prop,
25-
path,
2621
relationship,
22+
path,
23+
prop,
2724
step,
25+
dataSet,
26+
27+
list,
28+
map,
29+
set,
2830

2931
// basic types in dart
3032
bool,
@@ -43,11 +45,10 @@ enum GdbTypes {
4345
dateTime,
4446
duration,
4547

46-
list,
47-
map,
48-
set,
49-
none,
48+
line,
49+
point,
50+
polygon,
51+
geo,
5052

5153
unknown,
52-
dataSet,
5354
}

lib/src/value_meta_data.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ class ValueMetaData {
1010
final List<ValueMetaData> submetas = [];
1111

1212
/// add submeta (if absent) and return its index
13-
int addSubmeta(ValueMetaData submeta) {
14-
var idx =
15-
submetas.lastIndexWhere((element) => element.name == submeta.name);
13+
int addSubmeta(ValueMetaData submeta, List<dynamic>? values, dynamic val) {
14+
var idx = submetas.lastIndexWhere(
15+
(element) => element.name == submeta.name && submeta.name != null);
1616
if (idx == -1) {
1717
submetas.add(submeta);
18-
return submetas.length - 1;
18+
idx = submetas.length - 1;
19+
}
20+
if ((values?.length ?? 0) <= idx) {
21+
values?.length = idx + 1;
22+
values?[idx] = val;
1923
}
2024
return idx;
2125
}
@@ -27,8 +31,8 @@ class ValueMetaData {
2731

2832
Map<String, dynamic> toJson() {
2933
return {
30-
"'type'": type?.index,
31-
"'name'": "'$name'",
34+
"'type'": '\'${type?.name}\'',
35+
"'name'": name != null ? "'$name'" : null,
3236
"'submetas'": submetas.map((e) => e.toJson()).toList(),
3337
};
3438
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: dart_gdbc
22
description: A standard interface specification for accessing graph databases based on Dart language
3-
version: 0.0.1+1
3+
version: 0.0.1+2
44
repository: https://github.com/graph-cn/dart_gdbc
55

66
environment:

0 commit comments

Comments
 (0)