prql-rb 0.1.0-arm64-darwin

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 06cf4cd3958a83178a8e649b6bb1541309103b560d90fce1361ce0584ca47e43
4
+ data.tar.gz: 10816bdabb3e4189ba2ec9d35b5dfb2817865ac65cd10530cab01be79add5926
5
+ SHA512:
6
+ metadata.gz: 249b5c45ac5efb8a7ef4e68596503ec0f4a3b44dbc04d3d6aea215a4960498f761e24ec3f78ccb2e3a1d9b05da468c52b50fe5108280d7bd2a1d9d7d630480f4
7
+ data.tar.gz: f32107695a7fe0de72043db1706dda18f511868f71ed3bac58d7a310a0fc94fa23aaefca5ea0eb15638dbc5ebc082a89e909f0332eeeead846d7bfb0d37d641a
data/LICENSE ADDED
@@ -0,0 +1,3 @@
1
+ This project is licensed under the GNU Affero General Public License version 3
2
+ or any later version. See the repository-level LICENSE file for the complete
3
+ license text.
data/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # prql-rb
2
+
3
+ Ruby bindings for the [PRQL compiler](https://prql-lang.org) (`prqlc`), a
4
+ Rust implementation of the PRQL pipelined query language.
5
+
6
+ ```ruby
7
+ require "prql-rb"
8
+
9
+ PrqlRb.compile(<<~PRQL)
10
+ from transactions
11
+ filter amount > 100
12
+ select { id, amount }
13
+ PRQL
14
+ # => SELECT * FROM transactions WHERE amount > 100 ... (SQL)
15
+ ```
16
+
17
+ The default target dialect is PostgreSQL. Compilation failures raise
18
+ `PrqlRb::CompileError`. No SQL is ever executed.
19
+
20
+ ## Installation
21
+
22
+ Add to your Gemfile:
23
+
24
+ ```ruby
25
+ gem "prql-rb"
26
+ ```
27
+
28
+ Precompiled platform gems are published for `aarch64-linux`,
29
+ `x86_64-linux`, `arm64-darwin` and `x86_64-darwin`, so `bundle install`
30
+ works without a Rust toolchain on those platforms. Other platforms
31
+ build from source (requires Ruby 3.2+, Rust 1.85+).
32
+
33
+ ## API
34
+
35
+ - `PrqlRb.compile(source, target:, format:, signature_comment:)` —
36
+ compile PRQL source to a SQL string.
37
+ - `target` — SQL dialect, e.g. `"sql.postgres"` (default),
38
+ `"sql.sqlite"`, `"sql.ansi"`.
39
+ - `format` — pretty-print the output SQL (default `true`).
40
+ - `signature_comment` — append the compiler signature as a comment
41
+ (default `false`).
42
+ - `PrqlRb.compiler_version` — the bundled prqlc version.
43
+
44
+ ## Development
45
+
46
+ ```sh
47
+ bin/setup # bundle install + compile the extension
48
+ rake # clobber + compile + test
49
+ ```
50
+
51
+ To release: tag a commit `vX.Y.Z` and push — CI builds the platform
52
+ gems, attaches them to the GitHub release, and pushes everything to
53
+ RubyGems.org.
54
+
55
+ ## License
56
+
57
+ AGPL-3.0-or-later
data/bin/compile ADDED
@@ -0,0 +1,18 @@
1
+ require "fileutils"
2
+ require "rbconfig"
3
+
4
+ gem_root = File.expand_path("..", __dir__)
5
+ extension_dir = File.join(gem_root, "ext", "prql_rb")
6
+ lib_dir = File.join(gem_root, "lib")
7
+
8
+ Dir.chdir(extension_dir) do
9
+ system RbConfig.ruby, "extconf.rb", exception: true
10
+ system ENV.fetch("MAKE", "make"), exception: true
11
+ end
12
+
13
+ destination_dir = File.join(lib_dir, "prql_rb")
14
+ FileUtils.mkdir_p(destination_dir)
15
+ FileUtils.cp(
16
+ File.join(extension_dir, "prql_rb.#{RbConfig::CONFIG.fetch("DLEXT")}"),
17
+ destination_dir
18
+ )
data/bin/setup ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+ require "fileutils"
3
+
4
+ APP_ROOT = File.expand_path("..", __dir__)
5
+
6
+ def system!(*args)
7
+ system(*args, exception: true)
8
+ end
9
+
10
+ FileUtils.chdir APP_ROOT do
11
+ puts "== Installing dependencies =="
12
+ system("bundle check") || system!("bundle install")
13
+
14
+ puts "\n== Compiling native extension =="
15
+ system!("bundle exec ruby bin/compile")
16
+
17
+ puts "\n== Running tests =="
18
+ system!("bundle exec rake test")
19
+ end
data/lib/prql-rb.rb ADDED
@@ -0,0 +1,3 @@
1
+ # Entry point matching the gem name (prql-rb). Bundler auto-requires
2
+ # the gem name, so this shim forwards to the real module definition.
3
+ require_relative "prql_rb"
Binary file
Binary file
Binary file
@@ -0,0 +1,3 @@
1
+ module PrqlRb
2
+ VERSION = "0.1.0"
3
+ end
data/lib/prql_rb.rb ADDED
@@ -0,0 +1,19 @@
1
+ require_relative "prql_rb/version"
2
+
3
+ # Try the versioned extension first (precompiled fat gems ship
4
+ # lib/prql_rb/<ruby-version>/prql_rb.so), then fall back to a
5
+ # source-built extension at lib/prql_rb/prql_rb.so.
6
+ begin
7
+ RUBY_VERSION =~ /(\d+\.\d+)/
8
+ require_relative "prql_rb/#{Regexp.last_match(1)}/prql_rb"
9
+ rescue LoadError
10
+ require_relative "prql_rb/prql_rb"
11
+ end
12
+
13
+ module PrqlRb
14
+ DEFAULT_TARGET = "sql.postgres"
15
+
16
+ def self.compile(source, target: DEFAULT_TARGET, format: true, signature_comment: false)
17
+ native_compile(source, target, format, signature_comment)
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: prql-rb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: arm64-darwin
6
+ authors:
7
+ - Mendel Kramer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-09-04 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Ruby bindings for the PRQL compiler (prqlc), a Rust implementation of
14
+ the PRQL pipelined query language.
15
+ email:
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - LICENSE
21
+ - README.md
22
+ - bin/compile
23
+ - bin/setup
24
+ - lib/prql-rb.rb
25
+ - lib/prql_rb.rb
26
+ - lib/prql_rb/3.2/prql_rb.bundle
27
+ - lib/prql_rb/3.3/prql_rb.bundle
28
+ - lib/prql_rb/3.4/prql_rb.bundle
29
+ - lib/prql_rb/version.rb
30
+ homepage: https://github.com/mendelk/prql-rb
31
+ licenses:
32
+ - AGPL-3.0-or-later
33
+ metadata:
34
+ homepage_uri: https://github.com/mendelk/prql-rb
35
+ source_code_uri: https://github.com/mendelk/prql-rb
36
+ changelog_uri: https://github.com/mendelk/prql-rb/releases
37
+ rubygems_mfa_required: 'true'
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '3.2'
47
+ - - "<"
48
+ - !ruby/object:Gem::Version
49
+ version: 3.5.dev
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ requirements: []
56
+ rubygems_version: 3.5.23
57
+ signing_key:
58
+ specification_version: 4
59
+ summary: Compile PRQL to SQL using prqlc
60
+ test_files: []