b_b 0.1.2 → 0.1.3
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 +4 -4
- data/README.md +5 -2
- data/lib/b_b.rb +13 -6
- data/lib/b_b/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d54a68b4d017f46b01d54426bac23a31f2f3b90d
|
4
|
+
data.tar.gz: 2f35e172dabfaa3130d56f9019f3752c82116e0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d04e963de4c761c02dc2eb95bdda3bf2c2086f51cd1e32ce652cfa3bc2c9b909a6da8d814f65979fef3a9bb8e9e85f31f67d5b27da8964d39b59e452305647f
|
7
|
+
data.tar.gz: 736045fb04fdf1e17261cb754ddae50ea52c39671855070b18d976a89a431fb58d4146b6c7a0e07c021154d02c1836f9f2a4c99e57d0255d9adf7313c472e176
|
data/README.md
CHANGED
@@ -2,9 +2,10 @@
|
|
2
2
|
|
3
3
|
(b_b) is SQL Query Builder for [Google BigQuery](https://cloud.google.com/bigquery)
|
4
4
|
|
5
|
+
[](https://badge.fury.io/rb/b_b)
|
5
6
|
[](https://gemnasium.com/github.com/yhirano55/b_b)
|
6
7
|
[](https://travis-ci.org/yhirano55/b_b)
|
7
|
-
[](https://coveralls.io/github/yhirano55/b_b?branch=master)
|
8
|
+
[](https://coveralls.io/github/yhirano55/b_b?branch=master)
|
8
9
|
[](https://codebeat.co/projects/github-com-yhirano55-b_b)
|
9
10
|
|
10
11
|
## Install
|
@@ -37,6 +38,8 @@ Query Reference of BigQuery's query syntax and functions is [here](https://cloud
|
|
37
38
|
|
38
39
|
## Examples
|
39
40
|
|
41
|
+
L(b_b)z ==============33
|
42
|
+
|
40
43
|
### SELECT clause
|
41
44
|
|
42
45
|
```ruby
|
@@ -134,7 +137,7 @@ BB.having("first CONTAINS :first AND negram_count < :negram_count", first: "a",
|
|
134
137
|
# => "HAVING (first CONTAINS 'a' AND ngram_count < 10000)"
|
135
138
|
|
136
139
|
BB.having(first: "a").or.not.having(first: "b").to_sql
|
137
|
-
=> "HAVING (first = 'a') OR (first <> 'b')"
|
140
|
+
# => "HAVING (first = 'a') OR (first <> 'b')"
|
138
141
|
```
|
139
142
|
|
140
143
|
### ORDER BY clause
|
data/lib/b_b.rb
CHANGED
@@ -45,14 +45,21 @@ module BB
|
|
45
45
|
}.freeze
|
46
46
|
|
47
47
|
class << self
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
relation.
|
48
|
+
# Delegate to BB::Relation
|
49
|
+
def method_missing(method, *args, &block)
|
50
|
+
return super unless relation.respond_to?(method)
|
51
|
+
relation.send(method, *args, &block)
|
52
52
|
end
|
53
53
|
|
54
|
-
|
55
|
-
|
54
|
+
# Delegate to BB::Relation
|
55
|
+
def respond_to?(method, include_all = false)
|
56
|
+
relation.respond_to?(method, include_all) || super
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def relation
|
62
|
+
Relation.new
|
56
63
|
end
|
57
64
|
end
|
58
65
|
end
|
data/lib/b_b/version.rb
CHANGED