gitlab_query_language 0.33.0 → 0.34.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efc67a62c5a4a7b65893437c7169a62c98c61f7b930601a3ff573b60690f1ff4
4
- data.tar.gz: 754de91fd6f0f282dc61e4a2da2d9b455c236c8349141602fdd7c5171e650e6f
3
+ metadata.gz: d7cdd6bd11d7e366156839119ef7f7107b68be8165487b55576168593bd58b11
4
+ data.tar.gz: 6527786bb272eaf91e9b1a856a687d5b0e57cde94ec6fdffcbd4aa479aea3a92
5
5
  SHA512:
6
- metadata.gz: 49992be22a6a278078868b773a530b8f115c167d0168016637008cfd6413d1b5789f7cc782b424ecc30a9f783b5ea8701e365e53dc66d8c243d2ef487b35d224
7
- data.tar.gz: 07ac2f5cc058e586c3afec75e30a7c78b657c3900d65513d0ad3d8ff6236732952725ee25b7243409a631964a096bb3a8ba8d0a1775bcfacf36fb5fa5ebdb157
6
+ metadata.gz: 955c3f8eb6b3c0576e3f9561d8bf8fa806cf099086a793f88809aa3885123800a0011ec4d1a35fca0f7c9c32ae52e41ca2040a3b0b94691cd5d697fff3b16c84
7
+ data.tar.gz: 305ab838f4b12001fefaa2e007432b108c73c1ce2f5cc5bc52cdc6aa2d71f2342c864a318a032be023fbe52ca096e27fa6a199cb9ce3a067f86556fe385391a6
data/Cargo.lock CHANGED
@@ -233,7 +233,7 @@ checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
233
233
 
234
234
  [[package]]
235
235
  name = "glql"
236
- version = "0.33.0"
236
+ version = "0.34.0"
237
237
  dependencies = [
238
238
  "chrono",
239
239
  "graphql-parser",
@@ -579,6 +579,7 @@ version = "1.0.145"
579
579
  source = "registry+https://github.com/rust-lang/crates.io-index"
580
580
  checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
581
581
  dependencies = [
582
+ "indexmap",
582
583
  "itoa",
583
584
  "memchr",
584
585
  "ryu",
@@ -10,4 +10,4 @@ crate-type = ["cdylib"]
10
10
 
11
11
  [dependencies]
12
12
  magnus = { version = "0.6.2" }
13
- glql = { git = "https://gitlab.com/gitlab-org/glql.git", tag = "v0.33.0" }
13
+ glql = { git = "https://gitlab.com/gitlab-org/glql.git", tag = "v0.34.0" }
@@ -8,12 +8,17 @@ fn transform_rs(data: String, string_context: String) -> Result<String, Error> {
8
8
  Ok(glql::transform(data.as_str(), string_context.as_str()))
9
9
  }
10
10
 
11
+ fn schema_rs() -> Result<String, Error> {
12
+ Ok(glql::glql_schema())
13
+ }
14
+
11
15
  #[magnus::init]
12
16
  fn init(ruby: &Ruby) -> Result<(), Error> {
13
17
  let module = ruby.define_module("Glql")?;
14
18
 
15
19
  module.define_singleton_method("compile_rs", function!(compile_rs, 2))?;
16
20
  module.define_singleton_method("transform_rs", function!(transform_rs, 2))?;
21
+ module.define_singleton_method("schema_rs", function!(schema_rs, 0))?;
17
22
 
18
23
  Ok(())
19
24
  }
@@ -4,5 +4,5 @@
4
4
  # This version is kept in sync with the root Cargo.toml version.
5
5
  # A version bump will trigger a gem release.
6
6
  module Glql
7
- VERSION = "0.33.0"
7
+ VERSION = "0.34.0"
8
8
  end
@@ -24,5 +24,32 @@ module Glql
24
24
  result_json = transform_rs(data.to_json, context.to_json)
25
25
  JSON.parse(result_json)
26
26
  end
27
+
28
+ # The GLQL schema: every data source with its filter, display and sort
29
+ # fields, plus the operator, value kind, reference type and function
30
+ # vocabularies.
31
+ #
32
+ # `version` is this gem's version rather than a field of the document, so it
33
+ # cannot disagree with the artifact it shipped in. Merged last so a `version`
34
+ # in the document could not override it.
35
+ def schema
36
+ @schema ||= freeze_recursively(JSON.parse(schema_rs).merge("version" => VERSION))
37
+ end
38
+
39
+ private
40
+
41
+ # Freezes in place, at every level.
42
+ #
43
+ # `Hash#freeze` is shallow, and the memo above is shared for the life of the
44
+ # process: without this a caller mutating `schema["sources"]` would corrupt
45
+ # the document for every later reader.
46
+ def freeze_recursively(value)
47
+ case value
48
+ when Hash then value.each_value { |item| freeze_recursively(item) }
49
+ when Array then value.each { |item| freeze_recursively(item) }
50
+ end
51
+
52
+ value.freeze
53
+ end
27
54
  end
28
55
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_query_language
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.0
4
+ version: 0.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Himanshu Kapoor
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-07-30 00:00:00.000000000 Z
12
+ date: 2026-08-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rb_sys