cypher-graphdb 0.2.3__tar.gz → 0.2.4__tar.gz

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.
Files changed (282) hide show
  1. {cypher_graphdb-0.2.3/src/cypher_graphdb.egg-info → cypher_graphdb-0.2.4}/PKG-INFO +1 -1
  2. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backends/age/agebulkwriter.py +77 -8
  3. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backends/age/ageserializer.py +20 -12
  4. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backends/age/agesqlbuilder.py +37 -3
  5. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4/src/cypher_graphdb.egg-info}/PKG-INFO +1 -1
  6. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/.env.age.example +0 -0
  7. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/.env.example +0 -0
  8. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/.env.memgraph.example +0 -0
  9. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/.github/workflows/ci.yml +0 -0
  10. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/.github/workflows/publish.yml +0 -0
  11. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/.github/workflows/release.yml +0 -0
  12. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/.gitignore +0 -0
  13. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/.pre-commit-config.yaml +0 -0
  14. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/AGENTS.md +0 -0
  15. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/CHANGELOG.md +0 -0
  16. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/CONTRIBUTING.md +0 -0
  17. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/LICENSE.md +0 -0
  18. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/README.md +0 -0
  19. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/Taskfile.yml +0 -0
  20. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/cli +0 -0
  21. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/TODO.md +0 -0
  22. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/changelog.md +0 -0
  23. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/css/material.css +0 -0
  24. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/css/mkdocstrings.css +0 -0
  25. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/css/style.css +0 -0
  26. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/design/duckdb-migration.md +0 -0
  27. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/design/falkordb-integration.md +0 -0
  28. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/design/hierarchical-export-format.md +0 -0
  29. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/design/multiple-statement-execution.md +0 -0
  30. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/design/parameterized-queries-for-typed-models.md +0 -0
  31. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/design/query-result-immutable-design.md +0 -0
  32. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/design/read-only-mode.md +0 -0
  33. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/design/stateless-multi-graph-support.md +0 -0
  34. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/documentation-guide.md +0 -0
  35. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/examples/docstring_examples.py +0 -0
  36. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/index.md +0 -0
  37. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/reference/cypher_graphdb/backends/age/index.md +0 -0
  38. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/reference/cypher_graphdb/backends/index.md +0 -0
  39. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/reference/cypher_graphdb/cli/index.md +0 -0
  40. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/reference/cypher_graphdb/cypher/index.md +0 -0
  41. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/reference/cypher_graphdb/index.md +0 -0
  42. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/reference/cypher_graphdb/tools/index.md +0 -0
  43. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/docs/usage/index.md +0 -0
  44. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/mkdocs.yml +0 -0
  45. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/pyproject.toml +0 -0
  46. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/scripts/gen_ref_nav.py +0 -0
  47. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/setup.cfg +0 -0
  48. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/__init__.py +0 -0
  49. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/__main__.py +0 -0
  50. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/args.py +0 -0
  51. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backend.py +0 -0
  52. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backendprovider.py +0 -0
  53. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backends/__init__.py +0 -0
  54. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backends/age/__init__.py +0 -0
  55. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backends/age/agegraphdb.py +0 -0
  56. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backends/age/agerowfactories.py +0 -0
  57. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backends/age/agesearch.py +0 -0
  58. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backends/age/agtype.py +0 -0
  59. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backends/age/agtype_parser.py +0 -0
  60. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backends/memgraph/__init__.py +0 -0
  61. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backends/memgraph/memgraphdb.py +0 -0
  62. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/backends/memgraph/memgraphrowfactories.py +0 -0
  63. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cardinality.py +0 -0
  64. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/__init__.py +0 -0
  65. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/app.py +0 -0
  66. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/banner.py +0 -0
  67. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/command_manager.py +0 -0
  68. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/command_map.py +0 -0
  69. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/command_registry.py +0 -0
  70. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/__init__.py +0 -0
  71. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/add_graph_command.py +0 -0
  72. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/apply_config_command.py +0 -0
  73. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/base_command.py +0 -0
  74. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/clear_graph_command.py +0 -0
  75. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/commit_command.py +0 -0
  76. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/connect_command.py +0 -0
  77. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/create_edge_command.py +0 -0
  78. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/create_graph_command.py +0 -0
  79. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/create_linked_node_command.py +0 -0
  80. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/create_node_command.py +0 -0
  81. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/delete_graphobj_command.py +0 -0
  82. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/disconnect_command.py +0 -0
  83. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/drop_graph_command.py +0 -0
  84. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/dump_backends_command.py +0 -0
  85. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/dump_graphs_command.py +0 -0
  86. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/dump_indexes_command.py +0 -0
  87. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/dump_labels_command.py +0 -0
  88. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/dump_models_command.py +0 -0
  89. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/dump_parsed_query_command.py +0 -0
  90. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/dump_schema_command.py +0 -0
  91. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/dump_statistics_command.py +0 -0
  92. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/execute_cypher_command.py +0 -0
  93. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/execute_file_command.py +0 -0
  94. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/exit_command.py +0 -0
  95. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/export_graph_command.py +0 -0
  96. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/fetch_all_command.py +0 -0
  97. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/fetch_edges_command.py +0 -0
  98. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/fetch_nodes_command.py +0 -0
  99. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/format_output_command.py +0 -0
  100. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/get_command.py +0 -0
  101. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/gid_command.py +0 -0
  102. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/graph_exists_command.py +0 -0
  103. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/graph_op_command.py +0 -0
  104. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/graph_to_tree_command.py +0 -0
  105. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/help_command.py +0 -0
  106. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/import_graph_command.py +0 -0
  107. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/last_result_op_command.py +0 -0
  108. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/load_models_command.py +0 -0
  109. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/resolve_edges_command.py +0 -0
  110. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/rollback_command.py +0 -0
  111. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/search_command.py +0 -0
  112. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/set_command.py +0 -0
  113. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/sql_command.py +0 -0
  114. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/update_graphobj_command.py +0 -0
  115. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/commands/use_graph_command.py +0 -0
  116. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/completer.py +0 -0
  117. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/config.py +0 -0
  118. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/exporter.py +0 -0
  119. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/file_executor.py +0 -0
  120. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/graphdata.py +0 -0
  121. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/graphdb.py +0 -0
  122. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/help/_overview.md +0 -0
  123. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/help/_template.md +0 -0
  124. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/help/add_graph.md +0 -0
  125. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/help/exit.md +0 -0
  126. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/help/export_graph.md +0 -0
  127. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/help/import_graph.md +0 -0
  128. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/help/last_result.md +0 -0
  129. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/help.py +0 -0
  130. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/importer.py +0 -0
  131. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/prompt.py +0 -0
  132. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/promptparser.py +0 -0
  133. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/provider.py +0 -0
  134. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/renderer.py +0 -0
  135. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/runtime.py +0 -0
  136. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/schema_cmd.py +0 -0
  137. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cli/settings.py +0 -0
  138. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/command_reader.py +0 -0
  139. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/config.py +0 -0
  140. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/.antlr/Cypher.interp +0 -0
  141. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/.antlr/Cypher.tokens +0 -0
  142. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/.antlr/CypherBaseListener.java +0 -0
  143. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/.antlr/CypherLexer.interp +0 -0
  144. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/.antlr/CypherLexer.java +0 -0
  145. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/.antlr/CypherLexer.tokens +0 -0
  146. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/.antlr/CypherListener.java +0 -0
  147. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/.antlr/CypherParser.java +0 -0
  148. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/Cypher.g4 +0 -0
  149. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/Cypher.interp +0 -0
  150. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/Cypher.tokens +0 -0
  151. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/CypherLexer.interp +0 -0
  152. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/CypherLexer.py +0 -0
  153. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/CypherLexer.tokens +0 -0
  154. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/CypherListener.py +0 -0
  155. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/CypherParser.py +0 -0
  156. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypher/__init__.py +0 -0
  157. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypherbuilder.py +0 -0
  158. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cyphergraphdb/__init__.py +0 -0
  159. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cyphergraphdb/batch.py +0 -0
  160. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cyphergraphdb/bulk_normalize.py +0 -0
  161. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cyphergraphdb/connection.py +0 -0
  162. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cyphergraphdb/criteria.py +0 -0
  163. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cyphergraphdb/cyphergraphdb.py +0 -0
  164. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cyphergraphdb/indexing.py +0 -0
  165. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cyphergraphdb/result.py +0 -0
  166. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cyphergraphdb/schema.py +0 -0
  167. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cyphergraphdb/search.py +0 -0
  168. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cyphergraphdb/sql.py +0 -0
  169. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cyphergraphdb/stream_mixin.py +0 -0
  170. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypherjson.py +0 -0
  171. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/cypherparser.py +0 -0
  172. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/dbpool.py +0 -0
  173. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/decorators.py +0 -0
  174. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/display.py +0 -0
  175. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/exceptions.py +0 -0
  176. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/graphops.py +0 -0
  177. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/main.py +0 -0
  178. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/modelinfo.py +0 -0
  179. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/modelprovider.py +0 -0
  180. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/models.py +0 -0
  181. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/options.py +0 -0
  182. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/schema/__init__.py +0 -0
  183. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/schema/converter.py +0 -0
  184. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/schema/core.py +0 -0
  185. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/schema/generator.py +0 -0
  186. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/settings.py +0 -0
  187. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/statistics.py +0 -0
  188. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/__init__.py +0 -0
  189. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/base_exporter.py +0 -0
  190. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/base_importer.py +0 -0
  191. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/csv_exporter.py +0 -0
  192. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/csv_importer.py +0 -0
  193. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/csv_source.py +0 -0
  194. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/data_flattener.py +0 -0
  195. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/excel_exporter.py +0 -0
  196. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/excel_importer.py +0 -0
  197. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/excel_row_source.py +0 -0
  198. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/file_exporter.py +0 -0
  199. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/file_importer.py +0 -0
  200. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/hierarchical_exporter.py +0 -0
  201. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/hierarchical_importer.py +0 -0
  202. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/hierarchical_row_source.py +0 -0
  203. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/json_importer.py +0 -0
  204. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/json_yaml_data_source.py +0 -0
  205. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/row_collector.py +0 -0
  206. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/row_set.py +0 -0
  207. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/row_source.py +0 -0
  208. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/tabular_importer.py +0 -0
  209. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/tools/yaml_importer.py +0 -0
  210. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/utils/__init__.py +0 -0
  211. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/utils/collection_utils.py +0 -0
  212. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/utils/column_utils.py +0 -0
  213. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/utils/connection_utils.py +0 -0
  214. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/utils/conversion_utils.py +0 -0
  215. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/utils/core_utils.py +0 -0
  216. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/utils/schema_merge.py +0 -0
  217. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/utils/schema_to_llm.py +0 -0
  218. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/utils/schema_utils.py +0 -0
  219. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/utils/settings_repr.py +0 -0
  220. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb/utils/string_utils.py +0 -0
  221. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb.egg-info/SOURCES.txt +0 -0
  222. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb.egg-info/dependency_links.txt +0 -0
  223. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb.egg-info/entry_points.txt +0 -0
  224. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb.egg-info/requires.txt +0 -0
  225. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/src/cypher_graphdb.egg-info/top_level.txt +0 -0
  226. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/README.md +0 -0
  227. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/conftest.py +0 -0
  228. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/integration/__init__.py +0 -0
  229. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/integration/conftest.py +0 -0
  230. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/integration/test_basic_operations.py +0 -0
  231. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/integration/test_create_or_merge.py +0 -0
  232. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/integration/test_example.py +0 -0
  233. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/integration/test_indexes_and_bulk.py +0 -0
  234. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/integration/test_parameters.py +0 -0
  235. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/integration/test_read_only_mode.py +0 -0
  236. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/integration/test_streaming.py +0 -0
  237. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/test_json_schema_loading.py +0 -0
  238. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/test_json_schema_vs_decorators.py +0 -0
  239. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/README.md +0 -0
  240. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/__init__.py +0 -0
  241. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/cli/__init__.py +0 -0
  242. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/cli/test_cmd_map.py +0 -0
  243. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/cli/test_command_registry.py +0 -0
  244. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/mock_backend.py +0 -0
  245. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_age_serializer.py +0 -0
  246. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_age_sqlbuilder.py +0 -0
  247. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_agtype_parser.py +0 -0
  248. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_backend_capabilities.py +0 -0
  249. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_bulk_normalize.py +0 -0
  250. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_column_utils.py +0 -0
  251. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_command_reader.py +0 -0
  252. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_cypherbuilder.py +0 -0
  253. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_cypherparser.py +0 -0
  254. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_dbpool.py +0 -0
  255. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_dict_access_mixin.py +0 -0
  256. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_extend_relation_decorator.py +0 -0
  257. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_extend_relations.py +0 -0
  258. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_graph_id_zero.py +0 -0
  259. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_graphops.py +0 -0
  260. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_indexing.py +0 -0
  261. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_model_inheritance.py +0 -0
  262. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_modelinfo.py +0 -0
  263. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_modelprovider_loading.py +0 -0
  264. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_modelprovider_schemas.py +0 -0
  265. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_models.py +0 -0
  266. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/test_schema_converter.py +0 -0
  267. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/tools/__init__.py +0 -0
  268. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/tools/test_data_flattener.py +0 -0
  269. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/tools/test_exporters.py +0 -0
  270. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/tools/test_hierarchical_importer.py +0 -0
  271. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/tools/test_json_yaml_data_source.py +0 -0
  272. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/tools/test_resource_management.py +0 -0
  273. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/tools/test_tabular_import.py +0 -0
  274. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/utils/test_collection_utils.py +0 -0
  275. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/utils/test_connection_utils.py +0 -0
  276. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/utils/test_conversion_utils.py +0 -0
  277. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/utils/test_core_utils.py +0 -0
  278. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/utils/test_schema_merge.py +0 -0
  279. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/utils/test_schema_utils.py +0 -0
  280. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/utils/test_settings_repr.py +0 -0
  281. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/tests/unit/utils/test_string_utils.py +0 -0
  282. {cypher_graphdb-0.2.3 → cypher_graphdb-0.2.4}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cypher_graphdb
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: ORM like library and CLI for cypher query language supporting graph databases.
5
5
  Author-email: Wolfgang Miller <wolfgang.miller@petrarca-labs.com>
6
6
  License-Expression: Apache-2.0
@@ -37,6 +37,13 @@ class AGEBulkWriter:
37
37
  def __init__(self, connection: psycopg.Connection, graph_name: str) -> None:
38
38
  self._conn = connection
39
39
  self._graph_name = graph_name
40
+ # Cache for {(label, ref_prop): {ref_value: graphid}} maps.
41
+ # Avoids repeated full-table scans when bulk_insert_edges is called
42
+ # many times with the same src/dst labels (e.g. 400+ batches of CALLS
43
+ # edges all resolving against Method.qualified_name).
44
+ # Invalidated by invalidate_graphid_cache() after node inserts that
45
+ # change the graphid mapping.
46
+ self._graphid_cache: dict[tuple[str, str], dict[str, int]] = {}
40
47
 
41
48
  # -- Public API -----------------------------------------------------------
42
49
 
@@ -83,6 +90,9 @@ class AGEBulkWriter:
83
90
  total += len(batch)
84
91
 
85
92
  logger.debug("Direct SQL: {} {} nodes inserted", total, label)
93
+ # Invalidate cached graphid maps for this label so subsequent edge
94
+ # inserts see the newly created nodes.
95
+ self.invalidate_graphid_cache(label)
86
96
  return total
87
97
 
88
98
  def bulk_insert_edges(
@@ -122,12 +132,17 @@ class AGEBulkWriter:
122
132
 
123
133
  label_id = self._ensure_label(label, kind="e")
124
134
 
125
- # Build {ref_value: graphid} maps for source and destination nodes
126
- src_map = self._build_graphid_index(src_label, src_ref_prop)
135
+ # Collect the unique ref values we actually need -- avoids loading
136
+ # the entire label table (which can be 200K+ rows in a shared graph).
137
+ src_refs = {e["src"] for e in edges}
138
+ dst_refs = {e["dst"] for e in edges}
139
+
140
+ # Build {ref_value: graphid} maps for only the referenced nodes
141
+ src_map = self._build_graphid_index(src_label, src_ref_prop, ref_values=src_refs)
127
142
  if src_label == dst_label and src_ref_prop == dst_ref_prop:
128
- dst_map = src_map
143
+ dst_map = self._build_graphid_index(dst_label, dst_ref_prop, ref_values=src_refs | dst_refs)
129
144
  else:
130
- dst_map = self._build_graphid_index(dst_label, dst_ref_prop)
145
+ dst_map = self._build_graphid_index(dst_label, dst_ref_prop, ref_values=dst_refs)
131
146
 
132
147
  total = 0
133
148
  skipped = 0
@@ -240,14 +255,68 @@ class AGEBulkWriter:
240
255
  inner = inner.replace("'", "''")
241
256
  return "'" + inner + "'"
242
257
 
243
- def _build_graphid_index(self, label: str, ref_prop: str) -> dict[str, int]:
244
- """Load a {ref_prop_value: graphid} mapping for all nodes of a label.
258
+ def invalidate_graphid_cache(self, label: str | None = None) -> None:
259
+ """Drop cached graphid maps so the next lookup re-reads from the database.
260
+
261
+ Call after inserting nodes into a label that is later used as an edge
262
+ endpoint, so the graphid map includes the newly inserted nodes.
263
+
264
+ Args:
265
+ label: If given, only invalidate caches for this label.
266
+ If None, clear the entire cache.
267
+ """
268
+ if label is None:
269
+ self._graphid_cache.clear()
270
+ else:
271
+ keys_to_drop = [k for k in self._graphid_cache if k[0] == label]
272
+ for k in keys_to_drop:
273
+ del self._graphid_cache[k]
274
+
275
+ def _build_graphid_index(self, label: str, ref_prop: str, ref_values: set[str] | None = None) -> dict[str, int]:
276
+ """Load a {ref_prop_value: graphid} mapping for nodes of a label.
277
+
278
+ When ``ref_values`` is provided, only loads graphids for those specific
279
+ property values (using a WHERE IN clause). This is critical for shared
280
+ graphs where a label table may contain hundreds of thousands of rows
281
+ across all sources, but only a small subset is needed for the current
282
+ edge batch.
283
+
284
+ When ``ref_values`` is None, loads the entire table (used for small
285
+ labels like structural edges).
286
+
287
+ Results are cached per (label, ref_prop) and incrementally extended
288
+ when new ref_values are requested.
245
289
 
246
290
  Values returned by agtype_access_operator are agtype-quoted strings
247
291
  (e.g. '"mth:foo.bar"'), so we strip the surrounding quotes.
248
292
  """
249
- sql_stmt = SQLBuilder.lookup_node_graphids_sql(self._graph_name, label, ref_prop)
293
+ cache_key = (label, ref_prop)
294
+ cached = self._graphid_cache.get(cache_key)
295
+
296
+ if ref_values is not None and cached is not None:
297
+ # Check if all requested values are already in the cache
298
+ missing = ref_values - cached.keys()
299
+ if not missing:
300
+ return cached
301
+ # Only query the missing values
302
+ ref_values = missing
303
+
304
+ if ref_values is not None and ref_values:
305
+ sql_stmt = SQLBuilder.lookup_node_graphids_filtered_sql(self._graph_name, label, ref_prop, ref_values)
306
+ else:
307
+ sql_stmt = SQLBuilder.lookup_node_graphids_sql(self._graph_name, label, ref_prop)
308
+
250
309
  with self._conn.cursor() as cursor:
251
310
  cursor.execute(sql_stmt)
252
311
  rows = cursor.fetchall()
253
- return {str(r[0]).strip('"'): r[1] for r in rows}
312
+ result = {str(r[0]).strip('"'): r[1] for r in rows}
313
+
314
+ # Merge into cache
315
+ if cached is not None:
316
+ cached.update(result)
317
+ logger.debug("Graphid index extended for {}.{}: +{} entries (total {})", label, ref_prop, len(result), len(cached))
318
+ return cached
319
+
320
+ self._graphid_cache[cache_key] = result
321
+ logger.debug("Graphid index built for {}.{}: {} entries", label, ref_prop, len(result))
322
+ return result
@@ -16,12 +16,30 @@ Example output:
16
16
  """
17
17
 
18
18
 
19
+ def escape_string_inner(v: str) -> str:
20
+ """Escape a string for use inside a double-quoted agtype/Cypher literal.
21
+
22
+ Returns the escaped content without the surrounding double quotes.
23
+ Null bytes are stripped (agtype does not support them).
24
+
25
+ Order matters: backslashes must be escaped before other characters.
26
+ """
27
+ return (
28
+ v.replace("\\", "\\\\")
29
+ .replace('"', '\\"')
30
+ .replace("\n", "\\n")
31
+ .replace("\r", "\\r")
32
+ .replace("\t", "\\t")
33
+ .replace("\0", "")
34
+ )
35
+
36
+
19
37
  def escape_value(v: object) -> str:
20
38
  """Escape a Python value for inline AGE Cypher literals.
21
39
 
22
40
  Handles None, bool, int, float, and str-coercible values. Strings are
23
41
  escaped for double-quoted Cypher literals: backslashes, double quotes,
24
- newlines, carriage returns, and tabs are all escaped.
42
+ newlines, carriage returns, tabs, and null bytes are all handled.
25
43
 
26
44
  Args:
27
45
  v: Python value (None, bool, int, float, or str-coercible).
@@ -35,17 +53,7 @@ def escape_value(v: object) -> str:
35
53
  return "true" if v else "false"
36
54
  if isinstance(v, int | float):
37
55
  return str(v)
38
- # Order matters: escape backslashes first, then other characters
39
- escaped = (
40
- str(v)
41
- .replace("\\", "\\\\")
42
- .replace('"', '\\"')
43
- .replace("\n", "\\n")
44
- .replace("\r", "\\r")
45
- .replace("\t", "\\t")
46
- .replace("\0", "")
47
- )
48
- return f'"{escaped}"'
56
+ return f'"{escape_string_inner(str(v))}"'
49
57
 
50
58
 
51
59
  def to_cypher_list(rows: list[dict]) -> str:
@@ -9,6 +9,8 @@ from psycopg import sql
9
9
 
10
10
  from cypher_graphdb.cypherparser import ParsedCypherQuery
11
11
 
12
+ from .ageserializer import escape_string_inner
13
+
12
14
 
13
15
  class SQLBuilder:
14
16
  """SQL query builder for Apache AGE graph operations.
@@ -219,10 +221,11 @@ class SQLBuilder:
219
221
 
220
222
  @classmethod
221
223
  def lookup_node_graphids_sql(cls, graph_name: str, label: str, ref_prop: str) -> sql.SQL:
222
- """SQL to look up graphids of nodes by a property value.
224
+ """SQL to look up graphids of all nodes of a label by a property value.
223
225
 
224
- Returns SQL that takes a list of ref values and returns (ref_value, graphid) pairs.
225
- Uses the agtype_access_operator for property extraction (covered by expression indexes).
226
+ Returns (ref_value, graphid) pairs for every row in the label table.
227
+ Use ``lookup_node_graphids_filtered_sql`` when only a subset of values
228
+ is needed (avoids scanning hundreds of thousands of rows).
226
229
  """
227
230
  return sql.SQL(
228
231
  "SELECT ag_catalog.agtype_access_operator(VARIADIC ARRAY[properties, {prop}::ag_catalog.agtype])::text, id "
@@ -233,6 +236,37 @@ class SQLBuilder:
233
236
  prop=sql.Literal(f'"{ref_prop}"'),
234
237
  )
235
238
 
239
+ @classmethod
240
+ def lookup_node_graphids_filtered_sql(cls, graph_name: str, label: str, ref_prop: str, ref_values: set[str]) -> sql.SQL:
241
+ """SQL to look up graphids for a specific set of property values.
242
+
243
+ Uses a WHERE ... IN (...) clause with the same agtype_access_operator
244
+ expression as the expression index, so the btree index is used for
245
+ the filter. For 500 ref values against a 200K+ row table this turns
246
+ a sequential scan into 500 index lookups.
247
+
248
+ The ref values are cast to ``::ag_catalog.agtype`` to match the
249
+ expression index type exactly. Values containing double quotes or
250
+ backslashes are escaped for the agtype JSON string format before
251
+ being wrapped in the PostgreSQL string literal via sql.Literal.
252
+ """
253
+ # Build the IN list: each value is a double-quoted agtype string literal.
254
+ # escape_string_inner handles backslashes, double quotes, control chars,
255
+ # and null bytes -- identical escaping to the Cypher UNWIND path.
256
+ in_values = ", ".join(
257
+ sql.Literal('"' + escape_string_inner(v) + '"').as_string(None) + "::ag_catalog.agtype" for v in ref_values
258
+ )
259
+ return sql.SQL(
260
+ "SELECT ag_catalog.agtype_access_operator(VARIADIC ARRAY[properties, {prop}::ag_catalog.agtype])::text, id "
261
+ "FROM {schema}.{table} "
262
+ "WHERE ag_catalog.agtype_access_operator(VARIADIC ARRAY[properties, {prop}::ag_catalog.agtype]) IN ({in_vals})"
263
+ ).format(
264
+ schema=sql.Identifier(graph_name),
265
+ table=sql.Identifier(label),
266
+ prop=sql.Literal(f'"{ref_prop}"'),
267
+ in_vals=sql.SQL(in_values),
268
+ )
269
+
236
270
  @classmethod
237
271
  def list_indexes(cls, graph_name: str) -> sql.SQL:
238
272
  """List all user-created indexes in the graph schema via pg_indexes."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cypher_graphdb
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: ORM like library and CLI for cypher query language supporting graph databases.
5
5
  Author-email: Wolfgang Miller <wolfgang.miller@petrarca-labs.com>
6
6
  License-Expression: Apache-2.0
File without changes
File without changes
File without changes
File without changes