upsert 0.4.0 → 0.5.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.
- data/CHANGELOG +23 -1
- data/README.md +31 -18
- data/Rakefile +1 -0
- data/lib/upsert.rb +41 -10
- data/lib/upsert/active_record_upsert.rb +2 -2
- data/lib/upsert/binary.rb +1 -2
- data/lib/upsert/buffer/mysql2_client.rb +26 -13
- data/lib/upsert/buffer/pg_connection.rb +3 -38
- data/lib/upsert/buffer/pg_connection/column_definition.rb +59 -0
- data/lib/upsert/buffer/pg_connection/merge_function.rb +107 -66
- data/lib/upsert/buffer/sqlite3_database.rb +10 -2
- data/lib/upsert/cell.rb +9 -0
- data/lib/upsert/cell/mysql2_client.rb +16 -0
- data/lib/upsert/cell/pg_connection.rb +28 -0
- data/lib/upsert/cell/sqlite3_database.rb +36 -0
- data/lib/upsert/connection.rb +1 -1
- data/lib/upsert/connection/pg_connection.rb +8 -27
- data/lib/upsert/connection/sqlite3_database.rb +8 -24
- data/lib/upsert/row.rb +33 -47
- data/lib/upsert/row/mysql2_client.rb +21 -0
- data/lib/upsert/row/pg_connection.rb +7 -0
- data/lib/upsert/row/sqlite3_database.rb +7 -0
- data/lib/upsert/version.rb +1 -1
- data/spec/binary_spec.rb +2 -0
- data/spec/correctness_spec.rb +46 -13
- data/spec/database_functions_spec.rb +2 -2
- data/spec/database_spec.rb +2 -2
- data/spec/logger_spec.rb +1 -1
- data/spec/reserved_words_spec.rb +3 -3
- data/spec/spec_helper.rb +18 -12
- data/spec/speed_spec.rb +13 -13
- data/upsert.gemspec +6 -2
- metadata +12 -4
data/upsert.gemspec
CHANGED
@@ -4,8 +4,8 @@ require File.expand_path('../lib/upsert/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["Seamus Abshere"]
|
6
6
|
gem.email = ["seamus@abshere.net"]
|
7
|
-
gem.description = %q{Upsert for MySQL, PostgreSQL, and
|
8
|
-
gem.summary = %q{Upsert for MySQL, PostgreSQL, and
|
7
|
+
gem.description = %q{Upsert for MySQL, PostgreSQL, and SQLite3. Codifies various SQL MERGE tricks like MySQL's ON DUPLICATE KEY UPDATE, PostgreSQL's CREATE FUNCTION merge_db, and SQLite's INSERT OR IGNORE.}
|
8
|
+
gem.summary = %q{Upsert for MySQL, PostgreSQL, and SQLite3. Finally, all those SQL MERGE tricks codified.}
|
9
9
|
gem.homepage = "https://github.com/seamusabshere/upsert"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
@@ -29,4 +29,8 @@ Gem::Specification.new do |gem|
|
|
29
29
|
gem.add_development_dependency 'yard'
|
30
30
|
gem.add_development_dependency 'activerecord-import'
|
31
31
|
gem.add_development_dependency 'pry'
|
32
|
+
|
33
|
+
unless RUBY_VERSION >= '1.9'
|
34
|
+
gem.add_development_dependency 'orderedhash'
|
35
|
+
end
|
32
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upsert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: posix-spawn
|
@@ -219,7 +219,7 @@ dependencies:
|
|
219
219
|
- - ! '>='
|
220
220
|
- !ruby/object:Gem::Version
|
221
221
|
version: '0'
|
222
|
-
description: Upsert for MySQL, PostgreSQL, and
|
222
|
+
description: Upsert for MySQL, PostgreSQL, and SQLite3. Codifies various SQL MERGE
|
223
223
|
tricks like MySQL's ON DUPLICATE KEY UPDATE, PostgreSQL's CREATE FUNCTION merge_db,
|
224
224
|
and SQLite's INSERT OR IGNORE.
|
225
225
|
email:
|
@@ -241,13 +241,21 @@ files:
|
|
241
241
|
- lib/upsert/buffer.rb
|
242
242
|
- lib/upsert/buffer/mysql2_client.rb
|
243
243
|
- lib/upsert/buffer/pg_connection.rb
|
244
|
+
- lib/upsert/buffer/pg_connection/column_definition.rb
|
244
245
|
- lib/upsert/buffer/pg_connection/merge_function.rb
|
245
246
|
- lib/upsert/buffer/sqlite3_database.rb
|
247
|
+
- lib/upsert/cell.rb
|
248
|
+
- lib/upsert/cell/mysql2_client.rb
|
249
|
+
- lib/upsert/cell/pg_connection.rb
|
250
|
+
- lib/upsert/cell/sqlite3_database.rb
|
246
251
|
- lib/upsert/connection.rb
|
247
252
|
- lib/upsert/connection/mysql2_client.rb
|
248
253
|
- lib/upsert/connection/pg_connection.rb
|
249
254
|
- lib/upsert/connection/sqlite3_database.rb
|
250
255
|
- lib/upsert/row.rb
|
256
|
+
- lib/upsert/row/mysql2_client.rb
|
257
|
+
- lib/upsert/row/pg_connection.rb
|
258
|
+
- lib/upsert/row/sqlite3_database.rb
|
251
259
|
- lib/upsert/version.rb
|
252
260
|
- spec/active_record_upsert_spec.rb
|
253
261
|
- spec/binary_spec.rb
|
@@ -289,7 +297,7 @@ rubyforge_project:
|
|
289
297
|
rubygems_version: 1.8.24
|
290
298
|
signing_key:
|
291
299
|
specification_version: 3
|
292
|
-
summary: Upsert for MySQL, PostgreSQL, and
|
300
|
+
summary: Upsert for MySQL, PostgreSQL, and SQLite3. Finally, all those SQL MERGE tricks
|
293
301
|
codified.
|
294
302
|
test_files:
|
295
303
|
- spec/active_record_upsert_spec.rb
|