jade-sql 0.5.2 → 0.6.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: 9a368ab6b8f06dd2f2d97c0ac2ffab207f15a548375ea7b64f2857ea41e51aef
4
- data.tar.gz: b95392270986453c3429503b84631ef26c2fac9626df0a540e7fac499277fe1f
3
+ metadata.gz: 91ccd6b6039a017fd7233f251784fd6275d0b889ad6dbf4a0254e8de8bab4037
4
+ data.tar.gz: 075edb4238edd0cd475b0d4814043801691a0a6d30ecc06486893c456c6fa7b4
5
5
  SHA512:
6
- metadata.gz: 7e9c58d0015a7c767a536c4b8b750a744c9dc40ef39a3fb8fcb34e7cdba816050dead56229bdbe55359f7d42699de71ec6faaa68f03409ce640b2f0275f64220
7
- data.tar.gz: c64658fd2ae9eb7e10b847be092098c1688fbf7f311a53894f06912fc97665a057e30f192faf5d6f1c54cd3c9c72d295c7dcc7e06b277dde6d3fde99d68a1a13
6
+ metadata.gz: 25c6e87aae4190eae3d94eb852ee3cd2cee2fcf3fa786e416af8b8cf4963950586cc7dcd38a1928c6fadd119b3832cd2419c4202573ac02253040952828df2c8
7
+ data.tar.gz: e621c02ea5a122c726583584cd41ae3fa8a98dfec34d3e11e869a9d43f9c9c30d3e576c0589aab1070328f81e8c212eadc5c93a62c2939e77d5fe799634cdb55
data/docs/running.md CHANGED
@@ -89,7 +89,7 @@ describe MyApp do
89
89
  include Jade::Tasks::RSpec
90
90
 
91
91
  it 'queries patients' do
92
- all_calls_to(JadeSql::Runtime.port_execute_many) do |t, _pair|
92
+ all_calls_to(JadeSql::Runtime.port_execute_many) do |t, _sql, _params|
93
93
  t.ok([
94
94
  { "id" => 1, "name" => "Paul", "mrn" => "MRN-001" }
95
95
  ])
@@ -103,4 +103,4 @@ end
103
103
  The three ports are `port_execute_count`, `port_execute_one`,
104
104
  `port_execute_many` — `Sql.execute*` / `Sql.fetch_*` and their `*_raw`
105
105
  siblings ultimately dispatch through these. Stub them with
106
- `all_calls_to(JadeSql::Runtime.port_execute_*) { |t, pair| ... }`.
106
+ `all_calls_to(JadeSql::Runtime.port_execute_*) { |t, sql, params| ... }`.
@@ -9,8 +9,7 @@ module JadeSql
9
9
  module Runtime
10
10
  extend Jade::Port
11
11
 
12
- task :port_execute_count do |t, pair|
13
- sql, params = pair._1, pair._2
12
+ task :port_execute_count do |t, sql, params|
14
13
  conn = ::ActiveRecord::Base.connection
15
14
  t.ok(conn.exec_update(adapt_sql(fill_now(sql), conn), "Jade", typed_params(params, conn)))
16
15
  rescue ::ActiveRecord::RecordNotUnique => e
@@ -19,8 +18,7 @@ module JadeSql
19
18
  t.err(JadeSql::SqlErrors.db_error(e.message))
20
19
  end
21
20
 
22
- task :port_execute_one do |t, pair|
23
- sql, params = pair._1, pair._2
21
+ task :port_execute_one do |t, sql, params|
24
22
  conn = ::ActiveRecord::Base.connection
25
23
  rows = conn.exec_query(adapt_sql(fill_now(sql), conn), "Jade", typed_params(params, conn)).to_a
26
24
  case rows.length
@@ -34,8 +32,7 @@ module JadeSql
34
32
  t.err(JadeSql::SqlErrors.db_error(e.message))
35
33
  end
36
34
 
37
- task :port_execute_many do |t, pair|
38
- sql, params = pair._1, pair._2
35
+ task :port_execute_many do |t, sql, params|
39
36
  conn = ::ActiveRecord::Base.connection
40
37
  rows = conn.exec_query(adapt_sql(fill_now(sql), conn), "Jade", typed_params(params, conn)).to_a
41
38
  t.ok(rows.map { |row| coerce_row(row) })
data/lib/jade-sql/sql.jd CHANGED
@@ -403,9 +403,9 @@ end
403
403
 
404
404
 
405
405
  uses JadeSql::Runtime with
406
- port_execute_count : (String, List(Value)) -> Task(Int, SqlError),
407
- port_execute_one : (String, List(Value)) -> Task(a, SqlError),
408
- port_execute_many : (String, List(Value)) -> Task(List(a), SqlError),
406
+ port_execute_count : String, List(Value) -> Task(Int, SqlError),
407
+ port_execute_one : String, List(Value) -> Task(a, SqlError),
408
+ port_execute_many : String, List(Value) -> Task(List(a), SqlError),
409
409
  port_begin : Task(Bool, SqlError),
410
410
  port_commit : Task(Bool, SqlError),
411
411
  port_rollback : Task(Bool, SqlError)
@@ -413,17 +413,20 @@ end
413
413
 
414
414
 
415
415
  def execute_raw(p: (String, List(Value))) -> Task(Int, SqlError)
416
- port_execute_count(p)
416
+ (sql, params) = p
417
+ port_execute_count(sql, params)
417
418
  end
418
419
 
419
420
 
420
421
  def fetch_one_raw(p: (String, List(Value))) -> Task(a, SqlError)
421
- port_execute_one(p)
422
+ (sql, params) = p
423
+ port_execute_one(sql, params)
422
424
  end
423
425
 
424
426
 
425
427
  def fetch_many_raw(p: (String, List(Value))) -> Task(List(a), SqlError)
426
- port_execute_many(p)
428
+ (sql, params) = p
429
+ port_execute_many(sql, params)
427
430
  end
428
431
 
429
432
 
@@ -1,3 +1,3 @@
1
1
  module JadeSql
2
- VERSION = '0.5.2'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jade-sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - agustin
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-08-01 00:00:00.000000000 Z
10
+ date: 2026-08-03 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: jade-lang
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.3.0
18
+ version: 0.4.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 0.3.0
25
+ version: 0.4.0
26
26
  description: Query and mutation builders, schema generation from db/structure.sql,
27
27
  and an ActiveRecord-backed runtime for the Jade language. Renders typed queries
28
28
  to (String, List(Value)) and decodes rows into Jade structs.