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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8486d07dffd74cc99acc09f50b2d328a400d7184a4bb01cf3f9e65137f123c1a
4
- data.tar.gz: 7864b520d687801d1632ae51c9f30088a32630b9b3cff3a8adeeda8c2f815ad4
3
+ metadata.gz: a5138893ba365e2ed5b3510b31b05eed2e88acb05cae0a1aff4e7d1360fc840b
4
+ data.tar.gz: 4ccec8663601d669a8dfcc735f043ef8241ff2a18eb7e9984e60c1527aa01524
5
5
  SHA512:
6
- metadata.gz: d9d063f09423177c125a09313c98817ec238f49efacdcfd6880f10fdd0cd09f4e64755c641445c791532868df1e420bb14f79faea27c92d87bfb24a550866359
7
- data.tar.gz: '099c7c16f203f9c5c63e2dfd22622929416fe582f39d66e6377af02544b0ad5b20a86570a2b65b1f3b60f2274206cf7fb80d345ffd9d2dc29f39c197e89db1e3'
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.0
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-23 00:00:00.000000000 Z
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: A simple way to seed and synchronize table data using CSV files
185
+ summary: Provides a simple way to seed and synchronize table data using CSV files
186
186
  test_files: []