Skip to content

Commit

Permalink
v0.0.1+2
Browse files Browse the repository at this point in the history
  • Loading branch information
CorvusYe committed May 11, 2023
1 parent 81c7d64 commit 1511467
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.0.1+1
## 0.0.1+2

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

Expand Down
23 changes: 12 additions & 11 deletions lib/src/types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ abstract class MetaKey {

enum GdbTypes {
// types in graph database
line,
point,
polygon,
none,
node,
tag,
prop,
path,
relationship,
path,
prop,
step,
dataSet,

list,
map,
set,

// basic types in dart
bool,
Expand All @@ -43,11 +45,10 @@ enum GdbTypes {
dateTime,
duration,

list,
map,
set,
none,
line,
point,
polygon,
geo,

unknown,
dataSet,
}
16 changes: 10 additions & 6 deletions lib/src/value_meta_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ class ValueMetaData {
final List<ValueMetaData> submetas = [];

/// add submeta (if absent) and return its index
int addSubmeta(ValueMetaData submeta) {
var idx =
submetas.lastIndexWhere((element) => element.name == submeta.name);
int addSubmeta(ValueMetaData submeta, List<dynamic>? values, dynamic val) {
var idx = submetas.lastIndexWhere(
(element) => element.name == submeta.name && submeta.name != null);
if (idx == -1) {
submetas.add(submeta);
return submetas.length - 1;
idx = submetas.length - 1;
}
if ((values?.length ?? 0) <= idx) {
values?.length = idx + 1;
values?[idx] = val;
}
return idx;
}
Expand All @@ -27,8 +31,8 @@ class ValueMetaData {

Map<String, dynamic> toJson() {
return {
"'type'": type?.index,
"'name'": "'$name'",
"'type'": '\'${type?.name}\'',
"'name'": name != null ? "'$name'" : null,
"'submetas'": submetas.map((e) => e.toJson()).toList(),
};
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dart_gdbc
description: A standard interface specification for accessing graph databases based on Dart language
version: 0.0.1+1
version: 0.0.1+2
repository: https://github.com/graph-cn/dart_gdbc

environment:
Expand Down

0 comments on commit 1511467

Please sign in to comment.