gqlite 1.5.0 → 1.7.0

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 (119) hide show
  1. checksums.yaml +4 -4
  2. data/ext/Cargo.toml +12 -6
  3. data/ext/db-index/Cargo.toml +29 -0
  4. data/ext/db-index/src/hnsw/error.rs +66 -0
  5. data/ext/db-index/src/hnsw/graph_store.rs +272 -0
  6. data/ext/db-index/src/hnsw/id.rs +36 -0
  7. data/ext/db-index/src/hnsw/implementation.rs +1517 -0
  8. data/ext/db-index/src/hnsw/kernels.rs +1228 -0
  9. data/ext/db-index/src/hnsw/metric.rs +244 -0
  10. data/ext/db-index/src/hnsw/scalar.rs +72 -0
  11. data/ext/db-index/src/hnsw/simple_store.rs +140 -0
  12. data/ext/db-index/src/hnsw/store.rs +472 -0
  13. data/ext/db-index/src/hnsw/vector.rs +105 -0
  14. data/ext/db-index/src/hnsw/vectors.rs +568 -0
  15. data/ext/db-index/src/hnsw.rs +42 -0
  16. data/ext/db-index/src/lib.rs +3 -0
  17. data/ext/gqlitedb/Cargo.toml +19 -8
  18. data/ext/gqlitedb/benches/common/pokec.rs +62 -2
  19. data/ext/gqlitedb/benches/pokec_divan.rs +66 -2
  20. data/ext/gqlitedb/benches/pokec_iai.rs +60 -3
  21. data/ext/gqlitedb/release.toml +2 -2
  22. data/ext/gqlitedb/src/aggregators/arithmetic.rs +3 -1
  23. data/ext/gqlitedb/src/aggregators/containers.rs +1 -1
  24. data/ext/gqlitedb/src/aggregators/stats.rs +21 -12
  25. data/ext/gqlitedb/src/capi.rs +20 -24
  26. data/ext/gqlitedb/src/compiler/expression_analyser.rs +28 -20
  27. data/ext/gqlitedb/src/compiler/variables_manager.rs +104 -38
  28. data/ext/gqlitedb/src/compiler.rs +506 -227
  29. data/ext/gqlitedb/src/connection.rs +151 -11
  30. data/ext/gqlitedb/src/consts.rs +1 -2
  31. data/ext/gqlitedb/src/error.rs +123 -61
  32. data/ext/gqlitedb/src/functions/common.rs +64 -0
  33. data/ext/gqlitedb/src/functions/containers.rs +2 -46
  34. data/ext/gqlitedb/src/functions/edge.rs +1 -1
  35. data/ext/gqlitedb/src/functions/math.rs +87 -15
  36. data/ext/gqlitedb/src/functions/node.rs +1 -1
  37. data/ext/gqlitedb/src/functions/path.rs +48 -11
  38. data/ext/gqlitedb/src/functions/scalar.rs +47 -4
  39. data/ext/gqlitedb/src/functions/string.rs +123 -1
  40. data/ext/gqlitedb/src/functions/value.rs +1 -1
  41. data/ext/gqlitedb/src/functions.rs +165 -28
  42. data/ext/gqlitedb/src/graph.rs +1 -9
  43. data/ext/gqlitedb/src/interpreter/evaluators.rs +968 -130
  44. data/ext/gqlitedb/src/interpreter/instructions.rs +39 -2
  45. data/ext/gqlitedb/src/lib.rs +5 -4
  46. data/ext/gqlitedb/src/parser/gql.pest +1 -1
  47. data/ext/gqlitedb/src/planner.rs +329 -0
  48. data/ext/gqlitedb/src/prelude.rs +3 -3
  49. data/ext/gqlitedb/src/store/pgrx.rs +1 -1
  50. data/ext/gqlitedb/src/store/postgres.rs +742 -16
  51. data/ext/gqlitedb/src/store/redb/hnsw_store.rs +702 -0
  52. data/ext/gqlitedb/src/store/redb/index.rs +274 -0
  53. data/ext/gqlitedb/src/store/redb.rs +1268 -113
  54. data/ext/gqlitedb/src/store/sqlbase/sqlmetadata.rs +28 -0
  55. data/ext/gqlitedb/src/store/sqlbase/sqlstore.rs +103 -0
  56. data/ext/gqlitedb/src/store/sqlbase.rs +146 -16
  57. data/ext/gqlitedb/src/store/sqlite.rs +576 -14
  58. data/ext/gqlitedb/src/store/vector_extract.rs +56 -0
  59. data/ext/gqlitedb/src/store.rs +140 -29
  60. data/ext/gqlitedb/src/tests/compiler.rs +207 -10
  61. data/ext/gqlitedb/src/tests/connection/postgres.rs +38 -3
  62. data/ext/gqlitedb/src/tests/connection/redb.rs +23 -0
  63. data/ext/gqlitedb/src/tests/connection/sqlite.rs +31 -0
  64. data/ext/gqlitedb/src/tests/connection.rs +61 -1
  65. data/ext/gqlitedb/src/tests/evaluators.rs +162 -7
  66. data/ext/gqlitedb/src/tests/parser.rs +54 -23
  67. data/ext/gqlitedb/src/tests/planner.rs +511 -0
  68. data/ext/gqlitedb/src/tests/store/postgres.rs +7 -0
  69. data/ext/gqlitedb/src/tests/store/redb.rs +8 -0
  70. data/ext/gqlitedb/src/tests/store/sqlite.rs +8 -0
  71. data/ext/gqlitedb/src/tests/store/vector_index/postgres.rs +182 -0
  72. data/ext/gqlitedb/src/tests/store/vector_index/redb.rs +386 -0
  73. data/ext/gqlitedb/src/tests/store/vector_index/sqlite.rs +166 -0
  74. data/ext/gqlitedb/src/tests/store/vector_index.rs +2313 -0
  75. data/ext/gqlitedb/src/tests/store.rs +78 -14
  76. data/ext/gqlitedb/src/tests/templates/ast.rs +92 -16
  77. data/ext/gqlitedb/src/tests/templates/programs.rs +14 -7
  78. data/ext/gqlitedb/src/tests.rs +15 -9
  79. data/ext/gqlitedb/src/utils.rs +6 -1
  80. data/ext/gqlitedb/src/value/compare.rs +61 -3
  81. data/ext/gqlitedb/src/value.rs +136 -7
  82. data/ext/gqlitedb/templates/sql/postgres/metadata_delete.sql +1 -0
  83. data/ext/gqlitedb/templates/sql/postgres/node_select.sql +1 -1
  84. data/ext/gqlitedb/templates/sql/sqlite/metadata_delete.sql +1 -0
  85. data/ext/gqliterb/src/lib.rs +53 -8
  86. data/ext/gqlparser/Cargo.toml +25 -0
  87. data/ext/gqlparser/README.MD +9 -0
  88. data/ext/gqlparser/benches/pokec_divan.rs +34 -0
  89. data/ext/gqlparser/src/common.rs +69 -0
  90. data/ext/gqlparser/src/gqls/ast.rs +69 -0
  91. data/ext/gqlparser/src/gqls/constraint.rs +79 -0
  92. data/ext/gqlparser/src/gqls/error.rs +22 -0
  93. data/ext/gqlparser/src/gqls/parser.rs +813 -0
  94. data/ext/gqlparser/src/gqls/prelude.rs +8 -0
  95. data/ext/gqlparser/src/gqls/properties.rs +115 -0
  96. data/ext/gqlparser/src/gqls/resolve.rs +207 -0
  97. data/ext/gqlparser/src/gqls.rs +265 -0
  98. data/ext/gqlparser/src/lib.rs +7 -0
  99. data/ext/gqlparser/src/oc/ast.rs +680 -0
  100. data/ext/gqlparser/src/oc/error.rs +172 -0
  101. data/ext/gqlparser/src/oc/lexer.rs +429 -0
  102. data/ext/gqlparser/src/oc/parser/tests.rs +2284 -0
  103. data/ext/gqlparser/src/oc/parser.rs +2005 -0
  104. data/ext/gqlparser/src/oc.rs +33 -0
  105. data/ext/gqlparser/src/prelude.rs +3 -0
  106. data/ext/graphcore/Cargo.toml +1 -0
  107. data/ext/graphcore/src/error.rs +26 -0
  108. data/ext/graphcore/src/graph.rs +177 -51
  109. data/ext/graphcore/src/lib.rs +4 -2
  110. data/ext/graphcore/src/open_cypher.rs +12 -0
  111. data/ext/graphcore/src/table.rs +50 -2
  112. data/ext/graphcore/src/timestamp.rs +127 -104
  113. data/ext/graphcore/src/value/tensor.rs +739 -0
  114. data/ext/graphcore/src/value/value_map.rs +1 -1
  115. data/ext/graphcore/src/value.rs +343 -19
  116. metadata +93 -28
  117. data/ext/gqlitedb/src/parser/ast.rs +0 -604
  118. data/ext/gqlitedb/src/parser/parser_impl.rs +0 -1213
  119. data/ext/gqlitedb/src/parser.rs +0 -4
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gqlite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyrille Berger
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-01-18 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rb_sys
@@ -38,31 +37,65 @@ dependencies:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
39
  version: 1.2.0
41
- description: "GQLite is a Rust-language library, with a C interface, that implements
42
- a small, fast, self-contained, high-reliability, full-featured, Graph Query database
43
- engine.\nGQLite support multiple database backends, such as SQLite and redb.\nThis
44
- enable to achieve high performance and for application to combine Graph queries
45
- with traditional SQL queries.\n\nGQLite source code is license under the [MIT License](LICENSE)
46
- and is free to everyone to use for any purpose. \n\nThe official repositories contains
47
- bindings/APIs for C, C++, Python, Ruby and Crystal.\n\nThe library is still in its
48
- early stage, but it is now fully functional. Development effort has now slowed down
49
- and new features are added on a by-need basis. It supports a subset of OpenCypher,
50
- with some ISO GQL extensions.\n \nExample of use\n--------------\n\n```ruby\nrequire
51
- 'gqlite'\n\nbegin\n # Create a database on the file \"test.db\"\n connection =
52
- GQLite::Connection.new filename: \"test.db\"\n\n # Execute a simple query to create
53
- a node and return all the nodes\n value = connection.execute_oc_query(\"CREATE
54
- () MATCH (n) RETURN n\")\n\n # Print the result\n if value.nil?\n puts \"Empty
55
- results\"\n else\n puts \"Results are #{value.to_s}\"\n end\nrescue GQLite::Error
56
- => ex\n # Report any error\n puts \"An error has occured: #{ex.message}\"\nend\n\n```\n\nThe
57
- documentation for the GQL query language can found in [OpenCypher](https://auksys.org/documentation/5/libraries/gqlite/opencypher/)
58
- and for the [API](https://auksys.org/documentation/5/libraries/gqlite/api/).\n\n"
59
- email:
40
+ description: |+
41
+ GQLite is a Rust-language library, with a C interface, that implements a small, fast, self-contained, high-reliability, full-featured, Graph Query database engine.
42
+ GQLite support multiple database backends, such as SQLite and redb.
43
+ This enable to achieve high performance and for application to combine Graph queries with traditional SQL queries.
44
+
45
+ GQLite source code is license under the [MIT License](LICENSE) and is free to everyone to use for any purpose.
46
+
47
+ The official repositories contains bindings/APIs for C, C++, Python, Ruby and Crystal.
48
+
49
+ The library is still in its early stage, but it is now fully functional. Development effort has now slowed down and new features are added on a by-need basis. It supports a subset of OpenCypher, with some ISO GQL extensions.
50
+
51
+ Example of use
52
+ --------------
53
+
54
+ ```ruby
55
+ require 'gqlite'
56
+
57
+ begin
58
+ # Create a database on the file "test.db"
59
+ connection = GQLite::Connection.new filename: "test.db"
60
+
61
+ # Execute a simple query to create a node and return all the nodes
62
+ value = connection.execute_oc_query("CREATE () MATCH (n) RETURN n")
63
+
64
+ # Print the result
65
+ if value.nil?
66
+ puts "Empty results"
67
+ else
68
+ puts "Results are #{value.to_s}"
69
+ end
70
+ rescue GQLite::Error => ex
71
+ # Report any error
72
+ puts "An error has occured: #{ex.message}"
73
+ end
74
+
75
+ ```
76
+
77
+ The documentation for the GQL query language can found in [OpenCypher](https://auksys.org/documentation/5/libraries/gqlite/opencypher/) and for the [API](https://auksys.org/documentation/5/libraries/gqlite/api/).
78
+
60
79
  executables: []
61
80
  extensions:
62
81
  - ext/gqliterb/extconf.rb
63
82
  extra_rdoc_files: []
64
83
  files:
65
84
  - ext/Cargo.toml
85
+ - ext/db-index/Cargo.toml
86
+ - ext/db-index/src/hnsw.rs
87
+ - ext/db-index/src/hnsw/error.rs
88
+ - ext/db-index/src/hnsw/graph_store.rs
89
+ - ext/db-index/src/hnsw/id.rs
90
+ - ext/db-index/src/hnsw/implementation.rs
91
+ - ext/db-index/src/hnsw/kernels.rs
92
+ - ext/db-index/src/hnsw/metric.rs
93
+ - ext/db-index/src/hnsw/scalar.rs
94
+ - ext/db-index/src/hnsw/simple_store.rs
95
+ - ext/db-index/src/hnsw/store.rs
96
+ - ext/db-index/src/hnsw/vector.rs
97
+ - ext/db-index/src/hnsw/vectors.rs
98
+ - ext/db-index/src/lib.rs
66
99
  - ext/gqlitedb/Cargo.toml
67
100
  - ext/gqlitedb/askama.toml
68
101
  - ext/gqlitedb/benches/common/mod.rs
@@ -83,6 +116,7 @@ files:
83
116
  - ext/gqlitedb/src/consts.rs
84
117
  - ext/gqlitedb/src/error.rs
85
118
  - ext/gqlitedb/src/functions.rs
119
+ - ext/gqlitedb/src/functions/common.rs
86
120
  - ext/gqlitedb/src/functions/containers.rs
87
121
  - ext/gqlitedb/src/functions/edge.rs
88
122
  - ext/gqlitedb/src/functions/math.rs
@@ -96,16 +130,16 @@ files:
96
130
  - ext/gqlitedb/src/interpreter/instructions.rs
97
131
  - ext/gqlitedb/src/interpreter/mod.rs
98
132
  - ext/gqlitedb/src/lib.rs
99
- - ext/gqlitedb/src/parser.rs
100
- - ext/gqlitedb/src/parser/ast.rs
101
133
  - ext/gqlitedb/src/parser/gql.pest
102
- - ext/gqlitedb/src/parser/parser_impl.rs
134
+ - ext/gqlitedb/src/planner.rs
103
135
  - ext/gqlitedb/src/prelude.rs
104
136
  - ext/gqlitedb/src/query_result.rs
105
137
  - ext/gqlitedb/src/store.rs
106
138
  - ext/gqlitedb/src/store/pgrx.rs
107
139
  - ext/gqlitedb/src/store/postgres.rs
108
140
  - ext/gqlitedb/src/store/redb.rs
141
+ - ext/gqlitedb/src/store/redb/hnsw_store.rs
142
+ - ext/gqlitedb/src/store/redb/index.rs
109
143
  - ext/gqlitedb/src/store/sqlbase.rs
110
144
  - ext/gqlitedb/src/store/sqlbase/sqlbindingvalue.rs
111
145
  - ext/gqlitedb/src/store/sqlbase/sqlmetadata.rs
@@ -113,16 +147,24 @@ files:
113
147
  - ext/gqlitedb/src/store/sqlbase/sqlresultvalue.rs
114
148
  - ext/gqlitedb/src/store/sqlbase/sqlstore.rs
115
149
  - ext/gqlitedb/src/store/sqlite.rs
150
+ - ext/gqlitedb/src/store/vector_extract.rs
116
151
  - ext/gqlitedb/src/tests.rs
117
152
  - ext/gqlitedb/src/tests/compiler.rs
118
153
  - ext/gqlitedb/src/tests/connection.rs
119
154
  - ext/gqlitedb/src/tests/connection/postgres.rs
155
+ - ext/gqlitedb/src/tests/connection/redb.rs
156
+ - ext/gqlitedb/src/tests/connection/sqlite.rs
120
157
  - ext/gqlitedb/src/tests/evaluators.rs
121
158
  - ext/gqlitedb/src/tests/parser.rs
159
+ - ext/gqlitedb/src/tests/planner.rs
122
160
  - ext/gqlitedb/src/tests/store.rs
123
161
  - ext/gqlitedb/src/tests/store/postgres.rs
124
162
  - ext/gqlitedb/src/tests/store/redb.rs
125
163
  - ext/gqlitedb/src/tests/store/sqlite.rs
164
+ - ext/gqlitedb/src/tests/store/vector_index.rs
165
+ - ext/gqlitedb/src/tests/store/vector_index/postgres.rs
166
+ - ext/gqlitedb/src/tests/store/vector_index/redb.rs
167
+ - ext/gqlitedb/src/tests/store/vector_index/sqlite.rs
126
168
  - ext/gqlitedb/src/tests/templates.rs
127
169
  - ext/gqlitedb/src/tests/templates/ast.rs
128
170
  - ext/gqlitedb/src/tests/templates/programs.rs
@@ -141,6 +183,7 @@ files:
141
183
  - ext/gqlitedb/templates/sql/postgres/graph_create.sql
142
184
  - ext/gqlitedb/templates/sql/postgres/graph_delete.sql
143
185
  - ext/gqlitedb/templates/sql/postgres/metadata_create_table.sql
186
+ - ext/gqlitedb/templates/sql/postgres/metadata_delete.sql
144
187
  - ext/gqlitedb/templates/sql/postgres/metadata_get.sql
145
188
  - ext/gqlitedb/templates/sql/postgres/metadata_set.sql
146
189
  - ext/gqlitedb/templates/sql/postgres/node_create.sql
@@ -158,6 +201,7 @@ files:
158
201
  - ext/gqlitedb/templates/sql/sqlite/graph_create.sql
159
202
  - ext/gqlitedb/templates/sql/sqlite/graph_delete.sql
160
203
  - ext/gqlitedb/templates/sql/sqlite/metadata_create_table.sql
204
+ - ext/gqlitedb/templates/sql/sqlite/metadata_delete.sql
161
205
  - ext/gqlitedb/templates/sql/sqlite/metadata_get.sql
162
206
  - ext/gqlitedb/templates/sql/sqlite/metadata_set.sql
163
207
  - ext/gqlitedb/templates/sql/sqlite/node_create.sql
@@ -170,23 +214,44 @@ files:
170
214
  - ext/gqliterb/Cargo.toml
171
215
  - ext/gqliterb/extconf.rb
172
216
  - ext/gqliterb/src/lib.rs
217
+ - ext/gqlparser/Cargo.toml
218
+ - ext/gqlparser/README.MD
219
+ - ext/gqlparser/benches/pokec_divan.rs
220
+ - ext/gqlparser/src/common.rs
221
+ - ext/gqlparser/src/gqls.rs
222
+ - ext/gqlparser/src/gqls/ast.rs
223
+ - ext/gqlparser/src/gqls/constraint.rs
224
+ - ext/gqlparser/src/gqls/error.rs
225
+ - ext/gqlparser/src/gqls/parser.rs
226
+ - ext/gqlparser/src/gqls/prelude.rs
227
+ - ext/gqlparser/src/gqls/properties.rs
228
+ - ext/gqlparser/src/gqls/resolve.rs
229
+ - ext/gqlparser/src/lib.rs
230
+ - ext/gqlparser/src/oc.rs
231
+ - ext/gqlparser/src/oc/ast.rs
232
+ - ext/gqlparser/src/oc/error.rs
233
+ - ext/gqlparser/src/oc/lexer.rs
234
+ - ext/gqlparser/src/oc/parser.rs
235
+ - ext/gqlparser/src/oc/parser/tests.rs
236
+ - ext/gqlparser/src/prelude.rs
173
237
  - ext/graphcore/Cargo.toml
174
238
  - ext/graphcore/README.MD
175
239
  - ext/graphcore/src/error.rs
176
240
  - ext/graphcore/src/graph.rs
177
241
  - ext/graphcore/src/lib.rs
242
+ - ext/graphcore/src/open_cypher.rs
178
243
  - ext/graphcore/src/prelude.rs
179
244
  - ext/graphcore/src/serialize_with.rs
180
245
  - ext/graphcore/src/table.rs
181
246
  - ext/graphcore/src/timestamp.rs
182
247
  - ext/graphcore/src/value.rs
248
+ - ext/graphcore/src/value/tensor.rs
183
249
  - ext/graphcore/src/value/value_map.rs
184
250
  - lib/gqlite.rb
185
251
  homepage: https://gitlab.com/auksys/gqlite
186
252
  licenses:
187
253
  - MIT
188
254
  metadata: {}
189
- post_install_message:
190
255
  rdoc_options: []
191
256
  require_paths:
192
257
  - lib
@@ -201,8 +266,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
266
  - !ruby/object:Gem::Version
202
267
  version: '0'
203
268
  requirements: []
204
- rubygems_version: 3.4.20
205
- signing_key:
269
+ rubygems_version: 3.6.7
206
270
  specification_version: 4
207
271
  summary: Ruby bindings for GQLite, a Graph Query library.
208
272
  test_files: []
273
+ ...