pgslice 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/pgslice.rb +1 -3
- data/lib/pgslice/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af9d8b9872b5d7331a998243e48e9e9dd4f3a56f
|
4
|
+
data.tar.gz: edd651dc51c49176345a90515d852a936e8b696e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e521baa2ab4d83fbaff40781b1b1a0e49500ca0cc5d1a37a2decb9764f7cc7f2568815961b6212a7e6e0665c83a8ac42d642261d702ed34a3ef454a57341bf5f
|
7
|
+
data.tar.gz: 66d0e6a38534f4e15ac6d607958823ca4b55ccad80be22351fa7c7085121d049583254e1637e051020e4190622e9a8d2e03bad0dc06cdd8dd8908a44331cd425
|
data/CHANGELOG.md
CHANGED
data/lib/pgslice.rb
CHANGED
@@ -52,7 +52,6 @@ module PgSlice
|
|
52
52
|
|
53
53
|
def prep
|
54
54
|
table, column, period = arguments
|
55
|
-
cast = column_cast(table, column)
|
56
55
|
intermediate_table = "#{table}_intermediate"
|
57
56
|
trigger_name = self.trigger_name(table)
|
58
57
|
|
@@ -92,6 +91,7 @@ CREATE TRIGGER #{trigger_name}
|
|
92
91
|
FOR EACH ROW EXECUTE PROCEDURE #{trigger_name}();
|
93
92
|
SQL
|
94
93
|
|
94
|
+
cast = column_cast(table, column)
|
95
95
|
queries << <<-SQL
|
96
96
|
COMMENT ON TRIGGER #{trigger_name} ON #{intermediate_table} is 'column:#{column},period:#{period},cast:#{cast}';
|
97
97
|
SQL
|
@@ -262,7 +262,6 @@ CREATE OR REPLACE FUNCTION #{trigger_name}()
|
|
262
262
|
starting_id = max_dest_id
|
263
263
|
fields = columns(source_table).map { |c| PG::Connection.quote_ident(c) }.join(", ")
|
264
264
|
batch_size = options[:batch_size]
|
265
|
-
cast = column_cast(table, field)
|
266
265
|
|
267
266
|
i = 1
|
268
267
|
batch_count = ((max_source_id - starting_id) / batch_size.to_f).ceil
|
@@ -485,7 +484,6 @@ INSERT INTO #{dest_table} (#{fields})
|
|
485
484
|
end
|
486
485
|
|
487
486
|
def min_id(table, primary_key, column, cast, starting_time, where)
|
488
|
-
cast = column_cast(table, column)
|
489
487
|
query = "SELECT MIN(#{primary_key}) FROM #{table}"
|
490
488
|
conditions = []
|
491
489
|
conditions << "#{column} >= #{sql_date(starting_time, cast)}" if starting_time
|
data/lib/pgslice/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgslice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slop
|