bmg 0.20.1 → 0.20.2

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
  SHA1:
3
- metadata.gz: 35789fefdd2032b4e807b730fb2fc6f5abe163e1
4
- data.tar.gz: 2f20b907d1f66560cbe802c6b3fe3e4064b7bfd0
3
+ metadata.gz: 45a80b1a3fd00fc27f88f37b41816dd11324aa70
4
+ data.tar.gz: 9d600dd0619e0d814a07db94c95dc093b61584b9
5
5
  SHA512:
6
- metadata.gz: 8c1182190f70a94825505f358701e3ba728eadcfe7026da40f10b7b7dc9b2ff21d8f2f9ec2ccf24baa880b81728e9ef530830e168a33a2742a196c135445d0e5
7
- data.tar.gz: b2e7ef1f3bf5983cfd3ff6fbaff820a04f9f118e39df88728ad6c87fec7261269b9fe22f60d44f9d141ce47c78db5e91399345475835f5c88c7b44b16a1c5873
6
+ metadata.gz: 38fefe80ca45ddce14d3310621b82b389db5a7c11ab22bb17563c2c6f7dc769f9a54f9a3bebde6c40a2bbecbae215969857a8cf875a7363ad10261fd5b32b75f
7
+ data.tar.gz: 91492014f31ff3c540df388cac9e362e16555e373ca59ed178bdf32f7098d176947f7e6432df804a8bb3f34210d8a3762b92ce39d37455ff2ee2e55346bf9bce
@@ -11,7 +11,7 @@ module Bmg
11
11
  def on_with_exp(sexpr)
12
12
  if sequel_db.select(1).supports_cte?
13
13
  dataset = apply(sexpr.select_exp)
14
- apply(sexpr.with_spec).each_pair do |name,subquery|
14
+ apply(sexpr.with_spec).each_pair do |name, subquery|
15
15
  dataset = dataset.with(name, subquery)
16
16
  end
17
17
  dataset
@@ -39,6 +39,10 @@ module Bmg
39
39
  not(group_by_clause.nil?)
40
40
  end
41
41
 
42
+ def order_by?
43
+ not(order_by_clause.nil?)
44
+ end
45
+
42
46
  def ordering
43
47
  obc = order_by_clause
44
48
  obc && order_by_clause.to_ordering
@@ -18,12 +18,19 @@ module Bmg
18
18
  alias :on_intersect :on_set_operator
19
19
 
20
20
  def on_select_exp(sexpr)
21
- sexpr = builder.from_self(sexpr) if obc = sexpr.limit_or_offset?
21
+ sexpr = builder.from_self(sexpr) if must_from_self?(sexpr)
22
+
22
23
  limit_clause = builder.limit_clause(limit)
23
24
  offset_clause = builder.offset_clause(offset)
24
25
  sexpr.with_push(limit_clause, offset_clause)
25
26
  end
26
27
 
28
+ private
29
+
30
+ def must_from_self?(sexpr)
31
+ sexpr.limit_or_offset?
32
+ end
33
+
27
34
  end # class LimitOffset
28
35
  end # class Processor
29
36
  end # module Sql
@@ -17,7 +17,7 @@ module Bmg
17
17
  alias :on_intersect :on_set_operator
18
18
 
19
19
  def on_select_exp(sexpr)
20
- if obc = sexpr.order_by_clause
20
+ if sexpr.order_by? || sexpr.group_by?
21
21
  sexpr = builder.from_self(sexpr)
22
22
  call(sexpr)
23
23
  else
data/lib/bmg/version.rb CHANGED
@@ -2,7 +2,7 @@ module Bmg
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 20
5
- TINY = 1
5
+ TINY = 2
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.1
4
+ version: 0.20.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-31 00:00:00.000000000 Z
11
+ date: 2022-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: predicate