pg_csv 0.1.8 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +30 -29
- data/lib/pg_csv/version.rb +1 -1
- data/lib/pg_csv.rb +9 -5
- data/pg_csv.gemspec +6 -6
- data/spec/pg_csv_spec.rb +76 -61
- data/spec/spec_support.rb +11 -5
- metadata +33 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 88e1d29a5270587b750a05a8c3b620907988d0b4e8942ddc0dec4f8f14423d7e
|
4
|
+
data.tar.gz: 66d1d47569da691d87fba379cf223a10a8c405d20663375a75dc6fdb9068ffd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 575ef7200517a797d4b625c7dddc7e704ffa8719d1c7e6b4f19bbf0807204ea789317892bdd46ec07a6e698e86afb4282c2c5cfce60d0c1117527f8e1e3c22d3
|
7
|
+
data.tar.gz: f392c817d176ddc268c82b0f9f4aad2642ea60b93437602732a143526e36477837f12f3a879c663ef60ee24d0e0953c2b974036e973069a69a4ac61e03cb3457
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PgCsv
|
2
2
|
=====
|
3
3
|
|
4
|
-
Fast
|
4
|
+
Fast Ruby PG csv export. Uses pg function 'copy to csv'. Effective on millions rows.
|
5
5
|
|
6
6
|
Gemfile:
|
7
7
|
``` ruby
|
@@ -17,48 +17,49 @@ PgCsv.new(opts).export(to, opts)
|
|
17
17
|
|
18
18
|
Options:
|
19
19
|
``` ruby
|
20
|
-
:sql
|
21
|
-
:connection
|
22
|
-
:delimiter
|
23
|
-
:header
|
24
|
-
:logger
|
25
|
-
:columns
|
26
|
-
:encoding
|
20
|
+
:sql => plain sql ("select id, name from users")
|
21
|
+
:connection => ActiveRecord::Base.connection or PG::Connection(gem pg)
|
22
|
+
:delimiter => ["\t", ",", ]
|
23
|
+
:header => boolean, use pg header for fields?
|
24
|
+
:logger => logger
|
25
|
+
:columns => array of column names, ignore :header option
|
26
|
+
:encoding => encoding (default is pg_default), list of encodings: http://www.postgresql.org/docs/8.4/static/multibyte.html#CHARSET-TABLE
|
27
|
+
:force_quote => boolean, force quotes around all non-NULL data?
|
27
28
|
|
28
|
-
:temp_file
|
29
|
-
:temp_dir
|
29
|
+
:temp_file => boolean, generate throught temp file? final file appears by mv
|
30
|
+
:temp_dir => for :temp_file, ex: '/tmp'
|
30
31
|
|
31
|
-
:type
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
:type => :plain - return full string
|
33
|
+
=> :gzip - save file to gzip
|
34
|
+
=> :stream - save to stream
|
35
|
+
=> :file - just save to file = default
|
36
|
+
=> :yield - return each row to block
|
36
37
|
```
|
37
38
|
|
38
39
|
Examples:
|
39
40
|
``` ruby
|
40
|
-
PgCsv.new(:sql
|
41
|
-
PgCsv.new(:
|
42
|
-
PgCsv.new(:
|
43
|
-
PgCsv.new(:
|
44
|
-
File.open("a4.csv", 'a'){|f| PgCsv.new(:
|
45
|
-
export(f, :
|
46
|
-
PgCsv.new(:
|
47
|
-
PgCsv.new(:
|
48
|
-
PgCsv.new(:
|
49
|
-
PgCsv.new(:
|
50
|
-
export('a8.gz', :
|
41
|
+
PgCsv.new(sql: sql).export('a1.csv')
|
42
|
+
PgCsv.new(sql: sql).export('a2.gz', type: :gzip)
|
43
|
+
PgCsv.new(sql: sql).export('a3.csv', temp_file: true)
|
44
|
+
PgCsv.new(sql: sql, type: :plain).export
|
45
|
+
File.open("a4.csv", 'a'){ |f| PgCsv.new(sql: "select * from users").\
|
46
|
+
export(f, type: :stream) }
|
47
|
+
PgCsv.new(sql: sql).export('a5.csv', delimiter: "\t")
|
48
|
+
PgCsv.new(sql: sql).export('a6.csv', header: true)
|
49
|
+
PgCsv.new(sql: sql).export('a7.csv', columns: %w(id a b c))
|
50
|
+
PgCsv.new(sql: sql, connection: SomeDb.connection, columns: %w(id a b c), delimiter: "|").\
|
51
|
+
export('a8.gz', type: :gzip, temp_file: true)
|
51
52
|
|
52
53
|
# example collect from shards
|
53
54
|
Zlib::GzipWriter.open('some.gz') do |stream|
|
54
|
-
e = PgCsv.new(:
|
55
|
+
e = PgCsv.new(sql: sql, type: :stream)
|
55
56
|
ConnectionPool.each_shard do |connection|
|
56
|
-
e.export(stream, :
|
57
|
+
e.export(stream, connection: connection)
|
57
58
|
end
|
58
59
|
end
|
59
60
|
|
60
61
|
# yield example
|
61
|
-
PgCsv.new(:
|
62
|
+
PgCsv.new(sql: sql, type: :yield).export do |row|
|
62
63
|
puts row
|
63
64
|
end
|
64
65
|
```
|
data/lib/pg_csv/version.rb
CHANGED
data/lib/pg_csv.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'pg'
|
2
2
|
require File.expand_path(File.join(File.dirname(__FILE__), 'pg_csv/version'))
|
3
3
|
|
4
4
|
class PgCsv
|
@@ -6,13 +6,13 @@ class PgCsv
|
|
6
6
|
module Base
|
7
7
|
|
8
8
|
def initialize(opts = {})
|
9
|
-
@options = opts
|
9
|
+
@options = opts
|
10
10
|
end
|
11
11
|
|
12
12
|
# do export :to - filename or stream
|
13
13
|
def export(to = nil, opts = {}, &row_proc)
|
14
14
|
@row_proc = row_proc
|
15
|
-
@local_options = opts
|
15
|
+
@local_options = opts
|
16
16
|
|
17
17
|
raise ":connection should be" unless connection
|
18
18
|
raise ":sql should be" unless sql
|
@@ -97,7 +97,7 @@ class PgCsv
|
|
97
97
|
|
98
98
|
def load_data
|
99
99
|
info "#{query}"
|
100
|
-
raw = connection.raw_connection
|
100
|
+
raw = connection.respond_to?(:raw_connection) ? connection.raw_connection : connection
|
101
101
|
count = 0
|
102
102
|
|
103
103
|
info "=> query"
|
@@ -133,7 +133,7 @@ class PgCsv
|
|
133
133
|
) TO STDOUT
|
134
134
|
WITH CSV
|
135
135
|
DELIMITER '#{delimiter}'
|
136
|
-
#{use_pg_header? ? 'HEADER' : ''} #{encoding ? "ENCODING '#{encoding}'" : ''}
|
136
|
+
#{use_pg_header? ? 'HEADER' : ''} #{encoding ? "ENCODING '#{encoding}'" : ''} #{force_quote ? "FORCE QUOTE *" : ''}
|
137
137
|
SQL
|
138
138
|
end
|
139
139
|
|
@@ -193,6 +193,10 @@ class PgCsv
|
|
193
193
|
def encoding
|
194
194
|
o(:encoding)
|
195
195
|
end
|
196
|
+
|
197
|
+
def force_quote
|
198
|
+
o(:force_quote)
|
199
|
+
end
|
196
200
|
end
|
197
201
|
|
198
202
|
include Base
|
data/pg_csv.gemspec
CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.authors = ["Makarchev Konstantin"]
|
11
11
|
s.email = ["kostya27@gmail.com"]
|
12
12
|
s.homepage = "http://github.com/kostya/pg_csv"
|
13
|
-
s.summary = "Fast
|
14
|
-
s.description = "Fast
|
13
|
+
s.summary = "Fast Ruby PG csv export. Uses pg function 'copy to csv'. Effective on millions rows."
|
14
|
+
s.description = "Fast Ruby PG csv export. Uses pg function 'copy to csv'. Effective on millions rows."
|
15
15
|
|
16
16
|
s.files = `git ls-files`.split("\n")
|
17
17
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -19,9 +19,9 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
s.license = "MIT"
|
21
21
|
|
22
|
-
s.add_dependency "pg"
|
23
|
-
s.
|
24
|
-
s.add_development_dependency "rspec", '<3'
|
22
|
+
s.add_dependency "pg"
|
23
|
+
s.add_development_dependency "rspec"
|
25
24
|
s.add_development_dependency "rake"
|
26
|
-
|
25
|
+
s.add_development_dependency "activerecord"
|
26
|
+
s.add_development_dependency "byebug"
|
27
27
|
end
|
data/spec/pg_csv_spec.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
|
2
3
|
require File.dirname(__FILE__) + '/spec_helper'
|
3
4
|
|
4
5
|
describe PgCsv do
|
5
6
|
|
6
7
|
before :each do
|
7
8
|
Test.delete_all
|
8
|
-
Test.create :
|
9
|
-
Test.create :
|
9
|
+
Test.create a: 1, b: 2, c: 3
|
10
|
+
Test.create a: 4, b: 5, c: 6
|
10
11
|
|
11
12
|
@name = tmp_dir + "1.csv"
|
12
13
|
FileUtils.rm(@name) rescue nil
|
@@ -22,159 +23,173 @@ describe PgCsv do
|
|
22
23
|
describe "simple export" do
|
23
24
|
|
24
25
|
it "1" do
|
25
|
-
PgCsv.new(:
|
26
|
-
with_file(@name){|d| d.
|
26
|
+
PgCsv.new(sql: @sql0).export(@name)
|
27
|
+
with_file(@name){ |d| expect(d).to eq("1,2,3\n4,5,6\n")}
|
27
28
|
end
|
28
29
|
|
29
30
|
it "2" do
|
30
|
-
PgCsv.new(:
|
31
|
-
with_file(@name){|d| d.
|
31
|
+
PgCsv.new(sql: @sql).export(@name)
|
32
|
+
with_file(@name){ |d| expect(d).to eq("4,5,6\n1,2,3\n") }
|
32
33
|
end
|
33
34
|
|
34
35
|
it "delimiter" do
|
35
|
-
PgCsv.new(:
|
36
|
-
with_file(@name){|d| d.
|
36
|
+
PgCsv.new(sql: @sql).export(@name, delimiter: "|")
|
37
|
+
with_file(@name){ |d| expect(d).to eq("4|5|6\n1|2|3\n") }
|
37
38
|
end
|
38
39
|
|
39
40
|
it "encoding" do
|
40
|
-
Test.create!
|
41
|
+
Test.create!(a: 2, b: 3, c: 4, d: "абсд")
|
41
42
|
|
42
|
-
PgCsv.new(:
|
43
|
-
with_file(@name){|d| d.force_encoding('cp1251').
|
43
|
+
PgCsv.new(sql: "select d from tests where a = 2").export(@name, encoding: "WIN1251")
|
44
|
+
with_file(@name){ |d| expect(d.force_encoding('cp1251')).to eq("абсд\n".encode('cp1251')) }
|
44
45
|
end
|
45
46
|
|
46
47
|
describe "headers" do
|
47
48
|
it "header" do
|
48
|
-
PgCsv.new(:
|
49
|
-
with_file(@name){|d| d.
|
49
|
+
PgCsv.new(sql: @sql).export(@name, header: true)
|
50
|
+
with_file(@name){ |d| expect(d).to eq("a,b,c\n4,5,6\n1,2,3\n") }
|
50
51
|
end
|
51
52
|
|
52
53
|
it "columns" do
|
53
|
-
PgCsv.new(:
|
54
|
-
with_file(@name){|d| d.
|
54
|
+
PgCsv.new(sql: @sql).export(@name, columns: %w(q w e))
|
55
|
+
with_file(@name){ |d| expect(d).to eq("q,w,e\n4,5,6\n1,2,3\n") }
|
55
56
|
end
|
56
57
|
|
57
58
|
it "columns with header" do
|
58
|
-
PgCsv.new(:
|
59
|
+
PgCsv.new(sql: @sql).export(@name, header: true, columns: %w(q w e))
|
59
60
|
|
60
61
|
with_file(@name) do |d|
|
61
|
-
d.
|
62
|
+
expect(d).to eq("q,w,e\n4,5,6\n1,2,3\n")
|
62
63
|
end
|
63
64
|
end
|
64
65
|
end
|
65
66
|
|
67
|
+
describe "force_quote" do
|
68
|
+
it "force_quote" do
|
69
|
+
PgCsv.new(sql: @sql).export(@name, force_quote: true)
|
70
|
+
with_file(@name){ |d| expect(d).to eq("\"4\",\"5\",\"6\"\n\"1\",\"2\",\"3\"\n") }
|
71
|
+
end
|
72
|
+
|
73
|
+
it "with headers" do
|
74
|
+
PgCsv.new(sql: @sql).export(@name, header: true, force_quote: true)
|
75
|
+
with_file(@name){ |d| expect(d).to eq("a,b,c\n\"4\",\"5\",\"6\"\n\"1\",\"2\",\"3\"\n") }
|
76
|
+
end
|
77
|
+
end
|
66
78
|
end
|
67
79
|
|
68
80
|
describe "moving options no matter" do
|
69
81
|
it "1" do
|
70
|
-
PgCsv.new(:
|
71
|
-
with_file(@name){|d| d.
|
82
|
+
PgCsv.new(sql: @sql).export(@name, delimiter: "|")
|
83
|
+
with_file(@name){ |d| expect(d).to eq("4|5|6\n1|2|3\n") }
|
72
84
|
end
|
73
85
|
|
74
86
|
it "2" do
|
75
|
-
PgCsv.new(:
|
76
|
-
with_file(@name){|d| d.
|
87
|
+
PgCsv.new(delimiter: "|").export(@name, sql: @sql)
|
88
|
+
with_file(@name){ |d| expect(d).to eq("4|5|6\n1|2|3\n") }
|
77
89
|
end
|
78
90
|
end
|
79
91
|
|
80
92
|
describe "local options dont recover global" do
|
81
93
|
it "test" do
|
82
|
-
e = PgCsv.new(:
|
83
|
-
e.export(@name, :
|
84
|
-
with_file(@name){|d| d.
|
94
|
+
e = PgCsv.new(sql: @sql, delimiter: "*")
|
95
|
+
e.export(@name, delimiter: "|")
|
96
|
+
with_file(@name){ |d| expect(d).to eq("4|5|6\n1|2|3\n") }
|
85
97
|
|
86
98
|
e.export(@name)
|
87
|
-
with_file(@name){|d| d.
|
99
|
+
with_file(@name){ |d| expect(d).to eq("4*5*6\n1*2*3\n") }
|
88
100
|
end
|
89
101
|
end
|
90
102
|
|
91
103
|
describe "using temp file" do
|
92
104
|
it "at least file should return to target and set correct chmod" do
|
93
|
-
File.
|
94
|
-
PgCsv.new(:
|
95
|
-
with_file(@name){|d| d.
|
96
|
-
sprintf("%o", File.stat(@name).mode).to_i.
|
105
|
+
expect(File).not_to exist(@name)
|
106
|
+
PgCsv.new(sql: @sql, temp_file: true, temp_dir: tmp_dir).export(@name)
|
107
|
+
with_file(@name){ |d| expect(d).to eq("4,5,6\n1,2,3\n") }
|
108
|
+
expect(sprintf("%o", File.stat(@name).mode).to_i).to eq(100644)
|
97
109
|
end
|
98
110
|
|
99
111
|
it "same with gzip" do
|
100
|
-
File.
|
101
|
-
PgCsv.new(:
|
102
|
-
with_gzfile(@name){|d| d.
|
103
|
-
sprintf("%o", File.stat(@name).mode).to_i.
|
112
|
+
expect(File).not_to exist(@name)
|
113
|
+
PgCsv.new(sql: @sql, temp_file: true, temp_dir: tmp_dir, type: :gzip).export(@name)
|
114
|
+
with_gzfile(@name){ |d| expect(d).to eq("4,5,6\n1,2,3\n") }
|
115
|
+
expect(sprintf("%o", File.stat(@name).mode).to_i).to eq(100644)
|
104
116
|
end
|
105
117
|
end
|
106
118
|
|
107
119
|
describe "different types of export" do
|
108
120
|
it "gzip export" do
|
109
|
-
File.
|
110
|
-
PgCsv.new(:
|
111
|
-
with_gzfile(@name){|d| d.
|
112
|
-
sprintf("%o", File.stat(@name).mode).to_i.
|
121
|
+
expect(File).not_to exist(@name)
|
122
|
+
PgCsv.new(sql: @sql, type: :gzip).export(@name)
|
123
|
+
with_gzfile(@name){ |d| expect(d).to eq("4,5,6\n1,2,3\n") }
|
124
|
+
expect(sprintf("%o", File.stat(@name).mode).to_i).to eq(100644)
|
113
125
|
end
|
114
126
|
|
115
127
|
it "plain export" do
|
116
|
-
PgCsv.new(:
|
128
|
+
expect(PgCsv.new(sql: @sql, type: :plain).export).to eq("4,5,6\n1,2,3\n")
|
117
129
|
end
|
118
130
|
|
119
131
|
it "custom stream" do
|
120
|
-
ex = PgCsv.new(:
|
132
|
+
ex = PgCsv.new(sql: @sql, type: :stream)
|
121
133
|
File.open(@name, 'w') do |stream|
|
122
134
|
ex.export(stream)
|
123
|
-
ex.export(stream, :
|
135
|
+
ex.export(stream, sql: @sql0)
|
124
136
|
end
|
125
137
|
|
126
|
-
with_file(@name){|d| d.
|
138
|
+
with_file(@name){ |d| expect(d).to eq("4,5,6\n1,2,3\n1,2,3\n4,5,6\n") }
|
127
139
|
end
|
128
140
|
|
129
141
|
it "file as default" do
|
130
|
-
PgCsv.new(:
|
131
|
-
with_file(@name){|d| d.
|
132
|
-
sprintf("%o", File.stat(@name).mode).to_i.
|
142
|
+
PgCsv.new(sql: @sql, type: :file).export(@name)
|
143
|
+
with_file(@name){ |d| expect(d).to eq("4,5,6\n1,2,3\n") }
|
144
|
+
expect(sprintf("%o", File.stat(@name).mode).to_i).to eq(100644)
|
133
145
|
end
|
134
146
|
|
135
147
|
it "yield export" do
|
136
148
|
rows = []
|
137
|
-
|
138
|
-
rows << row
|
139
|
-
|
149
|
+
expect(
|
150
|
+
PgCsv.new(sql: @sql, type: :yield).export { |row| rows << row }
|
151
|
+
).to eq(2)
|
140
152
|
|
141
|
-
rows.
|
153
|
+
expect(rows).to eq(["4,5,6\n", "1,2,3\n"])
|
142
154
|
end
|
143
155
|
end
|
144
156
|
|
145
157
|
describe "integration specs" do
|
146
158
|
it "1" do
|
147
|
-
File.
|
148
|
-
PgCsv.new(:
|
149
|
-
|
159
|
+
expect(File).not_to exist(@name)
|
160
|
+
PgCsv.new(sql: @sql, type: :gzip).export(
|
161
|
+
@name, delimiter: "|", columns: %w(q w e), temp_file: true, temp_dir: tmp_dir
|
162
|
+
)
|
163
|
+
with_gzfile(@name){ |d| expect(d).to eq("q|w|e\n4|5|6\n1|2|3\n") }
|
150
164
|
end
|
151
165
|
|
152
166
|
it "2" do
|
153
167
|
Zlib::GzipWriter.open(@name) do |gz|
|
154
|
-
e = PgCsv.new(:
|
168
|
+
e = PgCsv.new(sql: @sql, type: :stream)
|
155
169
|
|
156
|
-
e.export(gz, :
|
157
|
-
e.export(gz, :
|
170
|
+
e.export(gz, delimiter: "|", columns: %w(q w e) )
|
171
|
+
e.export(gz, delimiter: "*", sql: @sql0)
|
158
172
|
end
|
159
173
|
|
160
|
-
with_gzfile(@name){|d| d.
|
174
|
+
with_gzfile(@name){ |d| expect(d).to eq("q|w|e\n4|5|6\n1|2|3\n1*2*3\n4*5*6\n") }
|
161
175
|
end
|
162
176
|
|
163
177
|
it "gzip with empty content" do
|
164
|
-
File.
|
165
|
-
PgCsv.new(:
|
166
|
-
|
178
|
+
expect(File).not_to exist(@name)
|
179
|
+
PgCsv.new(sql: "select a,b,c from tests where a = -1", type: :gzip).export(
|
180
|
+
@name, temp_file: true, temp_dir: tmp_dir
|
181
|
+
)
|
182
|
+
with_gzfile(@name){ |d| expect(d).to be_empty }
|
167
183
|
end
|
168
184
|
end
|
169
185
|
|
170
186
|
it "custom row proc" do
|
171
|
-
e = PgCsv.new(:
|
187
|
+
e = PgCsv.new(sql: @sql)
|
172
188
|
|
173
189
|
e.export(@name) do |row|
|
174
190
|
row.split(",").join("-|-")
|
175
191
|
end
|
176
192
|
|
177
|
-
with_file(@name){|d| d.
|
193
|
+
with_file(@name){ |d| expect(d).to eq("4-|-5-|-6\n1-|-2-|-3\n") }
|
178
194
|
end
|
179
|
-
|
180
195
|
end
|
data/spec/spec_support.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
require 'fileutils'
|
2
|
+
require 'active_record'
|
2
3
|
|
3
|
-
conn = {
|
4
|
+
conn = {
|
5
|
+
adapter: 'postgresql',
|
6
|
+
database: 'pgcsv_test',
|
7
|
+
encoding: "unicode"
|
8
|
+
}
|
4
9
|
ActiveRecord::Base.establish_connection conn
|
5
10
|
|
6
11
|
class Test < ActiveRecord::Base
|
@@ -28,7 +33,7 @@ def tmp_dir
|
|
28
33
|
end
|
29
34
|
|
30
35
|
def with_file(name)
|
31
|
-
File.
|
36
|
+
expect(File).to exist(name)
|
32
37
|
q = 1
|
33
38
|
File.open(name) do |file|
|
34
39
|
data = file.read
|
@@ -36,16 +41,17 @@ def with_file(name)
|
|
36
41
|
q = 2
|
37
42
|
end
|
38
43
|
|
39
|
-
q.
|
44
|
+
expect(q).to eq(2)
|
40
45
|
end
|
41
46
|
|
42
47
|
def with_gzfile(name)
|
43
|
-
File.exist
|
48
|
+
expect(File).to exist(name)
|
44
49
|
q = 1
|
45
50
|
Zlib::GzipReader.open(name) do |gz|
|
46
51
|
data = gz.read
|
47
52
|
yield data
|
48
53
|
q = 2
|
49
54
|
end
|
50
|
-
|
55
|
+
|
56
|
+
expect(q).to eq(2)
|
51
57
|
end
|
metadata
CHANGED
@@ -1,37 +1,37 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_csv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Makarchev Konstantin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
|
-
type: :
|
34
|
+
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
@@ -39,21 +39,35 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: activerecord
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: byebug
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - ">="
|
@@ -66,8 +80,8 @@ dependencies:
|
|
66
80
|
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
69
|
-
description: Fast
|
70
|
-
|
83
|
+
description: Fast Ruby PG csv export. Uses pg function 'copy to csv'. Effective on
|
84
|
+
millions rows.
|
71
85
|
email:
|
72
86
|
- kostya27@gmail.com
|
73
87
|
executables: []
|
@@ -107,10 +121,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
121
|
- !ruby/object:Gem::Version
|
108
122
|
version: '0'
|
109
123
|
requirements: []
|
110
|
-
|
111
|
-
rubygems_version: 2.2.2
|
124
|
+
rubygems_version: 3.1.2
|
112
125
|
signing_key:
|
113
126
|
specification_version: 4
|
114
|
-
summary: Fast
|
115
|
-
|
127
|
+
summary: Fast Ruby PG csv export. Uses pg function 'copy to csv'. Effective on millions
|
128
|
+
rows.
|
116
129
|
test_files: []
|