e621_export_downloader 0.0.10 → 0.0.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cdf6eb72073c33f50133fefd7ee264ee41edb965e61dcfc93efb81070a5bca32
4
- data.tar.gz: efa2bb88c808efd33f9f06ab6cb346c18cde1801154e9f52ccaf7631c6ab0755
3
+ metadata.gz: 570f83543711b092f8e72709bcc1c3a085ae7b865618551cf6fc4e3a9c749ec6
4
+ data.tar.gz: 81af136bb9ed74d51284480bed0ae38c3dcc25865e503f19bc651ff6694ec174
5
5
  SHA512:
6
- metadata.gz: 85e75b3913c5a918823d10b99e7b2c64b4b7b1fedfe91f336f57e3753ded6a6ad0d55446da4f91f4451dd79f54fe1cba84d17d38e5c0db772c8291bee3545ff9
7
- data.tar.gz: 3f806538638751982517fedb1ca79d142444dfebff3205815e5f8459d946a6a591e33b68e8c83029b56d25e3b704a3445d7a15a731121c2a14df9acce9c3c5f3
6
+ metadata.gz: b149322e32f32367c823377da011d5676227e7e4e454ff09eadabca03fdad57255bb72f5c10472a40e91594ec00e3bed8a47855dbc9deb7fd303c25a2fb941c3
7
+ data.tar.gz: 4edfafff035bd495ed6a9822b401853c5cc74c822cdea909403f051e8e03d55fd159d950d719023117c56fa48c9d40632e378d9dc464d554311d51992464f2c3
@@ -7,8 +7,11 @@ module E621
7
7
 
8
8
  sig { params(csv_path: String).returns(T.untyped) }
9
9
  def import_from_csv(csv_path)
10
- raw = T.unsafe(self).connection.raw_connection
11
- raw.copy_data("COPY #{T.unsafe(self).quoted_table_name} FROM STDIN WITH (FORMAT CSV, HEADER TRUE)") do
10
+ model = T.unsafe(self)
11
+ headers = File.open(csv_path, "rb", &:readline).chomp
12
+ columns = headers.split(",").map { |h| model.connection.quote_column_name(h.strip) }.join(", ")
13
+ raw = model.connection.raw_connection
14
+ raw.copy_data("COPY #{model.quoted_table_name} (#{columns}) FROM STDIN WITH (FORMAT CSV, HEADER TRUE)") do
12
15
  File.open(csv_path, "rb") do |f|
13
16
  raw.put_copy_data(f.read(65_536)) until f.eof?
14
17
  end
@@ -4,7 +4,7 @@
4
4
  # loaded by bundler
5
5
  module E621ExportDownloader
6
6
  module Constants
7
- VERSION = "0.0.10"
7
+ VERSION = "0.0.11"
8
8
  WEBSITE = "https://github.com/DonovanDMC/E621ExportDownloader.rb"
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: e621_export_downloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donovan_DMC
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-06-12 00:00:00.000000000 Z
10
+ date: 2026-06-13 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: csv