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.
@@ -1,6 +1,6 @@
1
1
  cmake_minimum_required(VERSION 3.15)
2
2
 
3
- project(Lbug VERSION 0.12.3.18 LANGUAGES CXX C)
3
+ project(Lbug VERSION 0.12.3.19 LANGUAGES CXX C)
4
4
 
5
5
  option(SINGLE_THREADED "Single-threaded mode" FALSE)
6
6
  if(SINGLE_THREADED)
@@ -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
- serialize_queries += f.readlines()
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 "dataset/demo-db/csv/user.csv"
2
- COPY City FROM "dataset/demo-db/csv/city.csv"
3
- COPY Follows FROM "dataset/demo-db/csv/follows.csv"
4
- COPY LivesIn FROM "dataset/demo-db/csv/lives-in.csv"
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 "dataset/demo-db/parquet/user.parquet";
2
- COPY City FROM "dataset/demo-db/parquet/city.parquet";
3
- COPY Follows FROM "dataset/demo-db/parquet/follows.parquet";
4
- COPY LivesIn FROM "dataset/demo-db/parquet/lives-in.parquet";
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
- auto fullPath = appendLbugRootPath(csvFilePath);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lbug",
3
- "version": "0.12.3-dev.18",
3
+ "version": "0.12.3-dev.19",
4
4
  "description": "An in-process property graph database management system built for query speed and scalability.",
5
5
  "main": "index.js",
6
6
  "module": "./index.mjs",
Binary file
Binary file
Binary file
Binary file