lbug 0.12.3-dev.18 → 0.12.3-dev.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lbug-source/CMakeLists.txt +1 -1
- package/lbug-source/benchmark/serializer.py +11 -1
- package/lbug-source/dataset/demo-db/csv/copy.cypher +4 -4
- package/lbug-source/dataset/demo-db/parquet/copy.cypher +4 -4
- package/lbug-source/test/test_helper/test_helper.cpp +9 -1
- package/lbug-source/tools/shell/embedded_shell.cpp +16 -0
- package/package.json +1 -1
- package/prebuilt/lbugjs-darwin-arm64.node +0 -0
- package/prebuilt/lbugjs-linux-arm64.node +0 -0
- package/prebuilt/lbugjs-linux-x64.node +0 -0
- package/prebuilt/lbugjs-win32-x64.node +0 -0
|
@@ -39,7 +39,17 @@ def serialize(lbug_exec_path, dataset_name, dataset_path, serialized_graph_path,
|
|
|
39
39
|
with open(os.path.join(dataset_path, 'schema.cypher'), 'r') as f:
|
|
40
40
|
serialize_queries += f.readlines()
|
|
41
41
|
with open(os.path.join(dataset_path, 'copy.cypher'), 'r') as f:
|
|
42
|
-
|
|
42
|
+
copy_lines = f.readlines()
|
|
43
|
+
# Fix relative paths in copy.cypher
|
|
44
|
+
for line in copy_lines:
|
|
45
|
+
# Replace quoted paths with absolute paths
|
|
46
|
+
def replace_path(match):
|
|
47
|
+
path = match.group(1)
|
|
48
|
+
if not os.path.isabs(path):
|
|
49
|
+
return '"' + os.path.join(dataset_path, path) + '"'
|
|
50
|
+
return match.group(0)
|
|
51
|
+
fixed_line = re.sub(r'"([^"]*)"', replace_path, line)
|
|
52
|
+
serialize_queries.append(fixed_line.strip())
|
|
43
53
|
else:
|
|
44
54
|
with open(os.path.join(base_dir, 'serialize.cypher'), 'r') as f:
|
|
45
55
|
serialize_queries += f.readlines()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
COPY User From "
|
|
2
|
-
COPY City FROM "
|
|
3
|
-
COPY Follows FROM "
|
|
4
|
-
COPY LivesIn FROM "
|
|
1
|
+
COPY User From "user.csv"
|
|
2
|
+
COPY City FROM "city.csv"
|
|
3
|
+
COPY Follows FROM "follows.csv"
|
|
4
|
+
COPY LivesIn FROM "lives-in.csv"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
COPY User From "
|
|
2
|
-
COPY City FROM "
|
|
3
|
-
COPY Follows FROM "
|
|
4
|
-
COPY LivesIn FROM "
|
|
1
|
+
COPY User From "user.parquet";
|
|
2
|
+
COPY City FROM "city.parquet";
|
|
3
|
+
COPY Follows FROM "follows.parquet";
|
|
4
|
+
COPY LivesIn FROM "lives-in.parquet";
|
|
@@ -32,6 +32,7 @@ void TestHelper::executeScript(const std::string& cypherScript, Connection& conn
|
|
|
32
32
|
std::cout << "cypherScript: " << cypherScript << " doesn't exist. Skipping..." << std::endl;
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
+
auto cypherDir = std::filesystem::path(cypherScript).parent_path();
|
|
35
36
|
std::ifstream file(cypherScript);
|
|
36
37
|
if (!file.is_open()) {
|
|
37
38
|
throw Exception(stringFormat("Error opening file: {}, errno: {}.", cypherScript, errno));
|
|
@@ -68,7 +69,14 @@ void TestHelper::executeScript(const std::string& cypherScript, Connection& conn
|
|
|
68
69
|
index = end + 1;
|
|
69
70
|
}
|
|
70
71
|
for (auto& csvFilePath : csvFilePaths) {
|
|
71
|
-
|
|
72
|
+
std::string fullPath = csvFilePath;
|
|
73
|
+
if (std::filesystem::path(csvFilePath).is_relative()) {
|
|
74
|
+
if (std::filesystem::path(csvFilePath).parent_path().empty()) {
|
|
75
|
+
fullPath = (cypherDir / csvFilePath).string();
|
|
76
|
+
} else {
|
|
77
|
+
fullPath = appendLbugRootPath(csvFilePath);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
72
80
|
line.replace(line.find(csvFilePath), csvFilePath.length(), fullPath);
|
|
73
81
|
}
|
|
74
82
|
// Also handle storage = 'path' for parquet tables
|
|
@@ -271,6 +271,22 @@ void completion(const char* buffer, linenoiseCompletions* lc) {
|
|
|
271
271
|
return;
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
// RETURN *; completion for MATCH and CALL queries.
|
|
275
|
+
// Trigger when buffer ends with ')' or ') ' after a MATCH pattern or CALL function.
|
|
276
|
+
if (regex_search(buf, std::regex(R"(\)\s*$)"))) {
|
|
277
|
+
// Check for MATCH pattern: MATCH(var:Table) or MATCH (var:Table)
|
|
278
|
+
bool isMatchQuery =
|
|
279
|
+
regex_search(buf, std::regex(R"(^\s*MATCH\s*\()", std::regex_constants::icase));
|
|
280
|
+
// Check for CALL function: CALL func_name(...) or CALL func_name (...)
|
|
281
|
+
bool isCallFunction =
|
|
282
|
+
regex_search(buf, std::regex(R"(^\s*CALL\s+\w+\s*\()", std::regex_constants::icase));
|
|
283
|
+
if (isMatchQuery || isCallFunction) {
|
|
284
|
+
std::string suffix = buf.back() == ')' ? " RETURN *;" : "RETURN *;";
|
|
285
|
+
linenoiseAddCompletion(lc, (buf + suffix).c_str());
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
274
290
|
// Node table name completion. Match patterns that include an open bracket `(` with no closing
|
|
275
291
|
// bracket `)`, and a colon `:` sometime after the open bracket.
|
|
276
292
|
if (regex_search(buf, std::regex("^[^]*\\([^\\)]*:[^\\)]*$"))) {
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|