activerecord-copy 1.0.0

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.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.rubocop.yml +40 -0
  4. data/.travis.yml +9 -0
  5. data/CHANGELOG.md +5 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +49 -0
  8. data/README.md +40 -0
  9. data/Rakefile +1 -0
  10. data/activerecord-copy.gemspec +25 -0
  11. data/lib/activerecord-copy.rb +92 -0
  12. data/lib/activerecord-copy/constants.rb +18 -0
  13. data/lib/activerecord-copy/decoder.rb +176 -0
  14. data/lib/activerecord-copy/encode_for_copy.rb +253 -0
  15. data/lib/activerecord-copy/exception.rb +4 -0
  16. data/lib/activerecord-copy/temp_buffer.rb +38 -0
  17. data/lib/activerecord-copy/version.rb +3 -0
  18. data/spec/big_write_spec.rb +17 -0
  19. data/spec/errors_spec.rb +8 -0
  20. data/spec/fixtures/3_col_array.txt +1 -0
  21. data/spec/fixtures/3_col_hstore.dat +0 -0
  22. data/spec/fixtures/3_col_hstore.txt +1 -0
  23. data/spec/fixtures/3_column_array.dat +0 -0
  24. data/spec/fixtures/array_with_two.dat +0 -0
  25. data/spec/fixtures/array_with_two2.dat +0 -0
  26. data/spec/fixtures/big_str_array.dat +0 -0
  27. data/spec/fixtures/big_str_array2.dat +0 -0
  28. data/spec/fixtures/bigint.dat +0 -0
  29. data/spec/fixtures/date.dat +0 -0
  30. data/spec/fixtures/date2.dat +0 -0
  31. data/spec/fixtures/date2000.dat +0 -0
  32. data/spec/fixtures/dates.dat +0 -0
  33. data/spec/fixtures/dates_p924.dat +0 -0
  34. data/spec/fixtures/dates_pg935.dat +0 -0
  35. data/spec/fixtures/empty_uuid.dat +0 -0
  36. data/spec/fixtures/falseclass.dat +0 -0
  37. data/spec/fixtures/float.dat +0 -0
  38. data/spec/fixtures/hstore_utf8.dat +0 -0
  39. data/spec/fixtures/intarray.dat +0 -0
  40. data/spec/fixtures/json.dat +0 -0
  41. data/spec/fixtures/json_array.dat +0 -0
  42. data/spec/fixtures/just_an_array.dat +0 -0
  43. data/spec/fixtures/just_an_array2.dat +0 -0
  44. data/spec/fixtures/multiline_hstore.dat +0 -0
  45. data/spec/fixtures/output.dat +0 -0
  46. data/spec/fixtures/timestamp.dat +0 -0
  47. data/spec/fixtures/timestamp_9.3.dat +0 -0
  48. data/spec/fixtures/timestamp_big.dat +0 -0
  49. data/spec/fixtures/timestamp_rounding.dat +0 -0
  50. data/spec/fixtures/trueclass.dat +0 -0
  51. data/spec/fixtures/utf8.dat +0 -0
  52. data/spec/fixtures/uuid.dat +0 -0
  53. data/spec/fixtures/uuid_array.dat +0 -0
  54. data/spec/multiline_spec.rb +17 -0
  55. data/spec/spec_helper.rb +22 -0
  56. data/spec/verify_data_formats_spec.rb +415 -0
  57. data/spec/verify_decoder_spec.rb +263 -0
  58. metadata +182 -0
metadata ADDED
@@ -0,0 +1,182 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activerecord-copy
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Lukas Fittl
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-07-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activerecord
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.12.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 2.12.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec-core
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 2.12.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 2.12.0
55
+ description: Supports binary COPY into PostgreSQL with activerecord
56
+ email:
57
+ - lukas@fittl.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rubocop.yml"
64
+ - ".travis.yml"
65
+ - CHANGELOG.md
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - activerecord-copy.gemspec
71
+ - lib/activerecord-copy.rb
72
+ - lib/activerecord-copy/constants.rb
73
+ - lib/activerecord-copy/decoder.rb
74
+ - lib/activerecord-copy/encode_for_copy.rb
75
+ - lib/activerecord-copy/exception.rb
76
+ - lib/activerecord-copy/temp_buffer.rb
77
+ - lib/activerecord-copy/version.rb
78
+ - spec/big_write_spec.rb
79
+ - spec/errors_spec.rb
80
+ - spec/fixtures/3_col_array.txt
81
+ - spec/fixtures/3_col_hstore.dat
82
+ - spec/fixtures/3_col_hstore.txt
83
+ - spec/fixtures/3_column_array.dat
84
+ - spec/fixtures/array_with_two.dat
85
+ - spec/fixtures/array_with_two2.dat
86
+ - spec/fixtures/big_str_array.dat
87
+ - spec/fixtures/big_str_array2.dat
88
+ - spec/fixtures/bigint.dat
89
+ - spec/fixtures/date.dat
90
+ - spec/fixtures/date2.dat
91
+ - spec/fixtures/date2000.dat
92
+ - spec/fixtures/dates.dat
93
+ - spec/fixtures/dates_p924.dat
94
+ - spec/fixtures/dates_pg935.dat
95
+ - spec/fixtures/empty_uuid.dat
96
+ - spec/fixtures/falseclass.dat
97
+ - spec/fixtures/float.dat
98
+ - spec/fixtures/hstore_utf8.dat
99
+ - spec/fixtures/intarray.dat
100
+ - spec/fixtures/json.dat
101
+ - spec/fixtures/json_array.dat
102
+ - spec/fixtures/just_an_array.dat
103
+ - spec/fixtures/just_an_array2.dat
104
+ - spec/fixtures/multiline_hstore.dat
105
+ - spec/fixtures/output.dat
106
+ - spec/fixtures/timestamp.dat
107
+ - spec/fixtures/timestamp_9.3.dat
108
+ - spec/fixtures/timestamp_big.dat
109
+ - spec/fixtures/timestamp_rounding.dat
110
+ - spec/fixtures/trueclass.dat
111
+ - spec/fixtures/utf8.dat
112
+ - spec/fixtures/uuid.dat
113
+ - spec/fixtures/uuid_array.dat
114
+ - spec/multiline_spec.rb
115
+ - spec/spec_helper.rb
116
+ - spec/verify_data_formats_spec.rb
117
+ - spec/verify_decoder_spec.rb
118
+ homepage: https://github.com/lfittl/activerecord-copy
119
+ licenses:
120
+ - MIT
121
+ metadata: {}
122
+ post_install_message:
123
+ rdoc_options: []
124
+ require_paths:
125
+ - lib
126
+ required_ruby_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ requirements: []
137
+ rubyforge_project:
138
+ rubygems_version: 2.4.5.1
139
+ signing_key:
140
+ specification_version: 4
141
+ summary: Convenient methods to load data quickly into Postgres
142
+ test_files:
143
+ - spec/big_write_spec.rb
144
+ - spec/errors_spec.rb
145
+ - spec/fixtures/3_col_array.txt
146
+ - spec/fixtures/3_col_hstore.dat
147
+ - spec/fixtures/3_col_hstore.txt
148
+ - spec/fixtures/3_column_array.dat
149
+ - spec/fixtures/array_with_two.dat
150
+ - spec/fixtures/array_with_two2.dat
151
+ - spec/fixtures/big_str_array.dat
152
+ - spec/fixtures/big_str_array2.dat
153
+ - spec/fixtures/bigint.dat
154
+ - spec/fixtures/date.dat
155
+ - spec/fixtures/date2.dat
156
+ - spec/fixtures/date2000.dat
157
+ - spec/fixtures/dates.dat
158
+ - spec/fixtures/dates_p924.dat
159
+ - spec/fixtures/dates_pg935.dat
160
+ - spec/fixtures/empty_uuid.dat
161
+ - spec/fixtures/falseclass.dat
162
+ - spec/fixtures/float.dat
163
+ - spec/fixtures/hstore_utf8.dat
164
+ - spec/fixtures/intarray.dat
165
+ - spec/fixtures/json.dat
166
+ - spec/fixtures/json_array.dat
167
+ - spec/fixtures/just_an_array.dat
168
+ - spec/fixtures/just_an_array2.dat
169
+ - spec/fixtures/multiline_hstore.dat
170
+ - spec/fixtures/output.dat
171
+ - spec/fixtures/timestamp.dat
172
+ - spec/fixtures/timestamp_9.3.dat
173
+ - spec/fixtures/timestamp_big.dat
174
+ - spec/fixtures/timestamp_rounding.dat
175
+ - spec/fixtures/trueclass.dat
176
+ - spec/fixtures/utf8.dat
177
+ - spec/fixtures/uuid.dat
178
+ - spec/fixtures/uuid_array.dat
179
+ - spec/multiline_spec.rb
180
+ - spec/spec_helper.rb
181
+ - spec/verify_data_formats_spec.rb
182
+ - spec/verify_decoder_spec.rb