sequel-bigquery 0.2.0 → 0.3.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 +4 -4
- data/README.md +1 -0
- data/lib/sequel-bigquery.rb +16 -0
- data/lib/sequel_bigquery/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1df3065759c1f700359a326b1e039e2e31c7d67785c5fe5c36d11d9933bc03a
|
4
|
+
data.tar.gz: 73c44cf0e5a3afea392ca675f7645a788698de6b357f9ec1023f72b5da803891
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fe03d5ba85f4b7daf490f5f1f6038f8d2101c78afcc20911a2b909c2bb73c683d8a094c3cf9229871dc6f2862b746cfd14797fe8d5091904955450600a25383
|
7
|
+
data.tar.gz: bb26c418a72d251ab8d68d458ff51a108f053d83cbf326e962aa8cce446e0d5726b4da8d3d1ba7c50978d6e7de4ef362003eeea74fa414a4c5fbb6e2cf39a370
|
data/README.md
CHANGED
@@ -31,6 +31,7 @@ Features:
|
|
31
31
|
- Updating rows, with automatic addition of `where 1 = 1` to statements (since BigQuery requires a `where` clause)
|
32
32
|
- Querying
|
33
33
|
- Transactions (buffered since BigQuery only supports them when you execute the whole transaction at once)
|
34
|
+
- Table partitioning
|
34
35
|
- Ruby types:
|
35
36
|
+ String
|
36
37
|
+ Integer
|
data/lib/sequel-bigquery.rb
CHANGED
@@ -173,6 +173,22 @@ module Sequel
|
|
173
173
|
'Note that no result data is returned while the transaction is open.',
|
174
174
|
)
|
175
175
|
end
|
176
|
+
|
177
|
+
# SQL for creating a table with BigQuery specific options
|
178
|
+
def create_table_sql(name, generator, options)
|
179
|
+
"#{super}#{create_table_suffix_sql(name, options)}"
|
180
|
+
end
|
181
|
+
|
182
|
+
# Handle BigQuery specific table extensions (i.e. partitioning)
|
183
|
+
def create_table_suffix_sql(_name, options)
|
184
|
+
sql = +''
|
185
|
+
|
186
|
+
if (partition_by = options[:partition_by])
|
187
|
+
sql << " PARTITION BY #{literal(Array(partition_by))}"
|
188
|
+
end
|
189
|
+
|
190
|
+
sql
|
191
|
+
end
|
176
192
|
end
|
177
193
|
|
178
194
|
class Dataset < Sequel::Dataset
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel-bigquery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brendan Weibrecht
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: amazing_print
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
|
-
rubygems_version: 3.
|
101
|
+
rubygems_version: 3.2.16
|
102
102
|
signing_key:
|
103
103
|
specification_version: 4
|
104
104
|
summary: A Sequel adapter for Google's BigQuery
|