sequel-from_csv 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/lib/sequel/plugins/from_csv.rb +2 -2
- 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: a5138893ba365e2ed5b3510b31b05eed2e88acb05cae0a1aff4e7d1360fc840b
|
4
|
+
data.tar.gz: 4ccec8663601d669a8dfcc735f043ef8241ff2a18eb7e9984e60c1527aa01524
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dd826cfca182e72f3b727e68c745d992d357d9c44b822b127d4d9105595edf5a56116f75e8b83f21107fa71595e3aae0abcc54b9ae2baa3cd996bf8deaa88e7
|
7
|
+
data.tar.gz: 8a87d2c6e946e65e5cc3a9e0b4f9e37adb1a4378a31d878f16e50ed2640489ec256d17fd4552801689903bb0d46ed90e2c826cb772d827b7390d70fd9c86d350
|
@@ -29,7 +29,7 @@ module Sequel
|
|
29
29
|
def seed_from_csv csv_path, delete_missing: false, resequence: false
|
30
30
|
|
31
31
|
# Read the source CSV file
|
32
|
-
data = CSV.table csv_path, converters: :date_time
|
32
|
+
data = CSV.table csv_path, converters: :date_time, header_converters: -> (h) { h.to_sym }
|
33
33
|
|
34
34
|
# Guard against CSV files that have headers but not data (to handle a quirk in Ruby's CSV parser)
|
35
35
|
if data.headers.empty?
|
@@ -66,7 +66,7 @@ module Sequel
|
|
66
66
|
when :postgres
|
67
67
|
self.db.run <<~SQL
|
68
68
|
SELECT
|
69
|
-
setval(pg_get_serial_sequence('#{self.simple_table}', '#{pk}'), greatest(max(#{pk}), 1), true)
|
69
|
+
setval(pg_get_serial_sequence('#{self.simple_table}', '#{pk}'), greatest(max(#{self.db.quote_identifier pk}), 1), true)
|
70
70
|
FROM
|
71
71
|
#{self.simple_table}
|
72
72
|
SQL
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel-from_csv
|
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
|
- Kenaniah Cerny
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -182,5 +182,5 @@ rubyforge_project:
|
|
182
182
|
rubygems_version: 2.7.6
|
183
183
|
signing_key:
|
184
184
|
specification_version: 4
|
185
|
-
summary:
|
185
|
+
summary: Provides a simple way to seed and synchronize table data using CSV files
|
186
186
|
test_files: []
|