upsert 1.1.7 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/CHANGELOG +14 -0
- data/Gemfile +0 -3
- data/LICENSE +2 -2
- data/README.md +3 -1
- data/lib/upsert.rb +1 -0
- data/lib/upsert/column_definition/sqlite3.rb +27 -0
- data/lib/upsert/connection.rb +2 -0
- data/lib/upsert/connection/sqlite3.rb +1 -5
- data/lib/upsert/merge_function.rb +11 -0
- data/lib/upsert/merge_function/mysql.rb +2 -1
- data/lib/upsert/merge_function/postgresql.rb +2 -1
- data/lib/upsert/merge_function/sqlite3.rb +6 -3
- data/lib/upsert/version.rb +1 -1
- data/spec/correctness_spec.rb +26 -0
- data/spec/database_spec.rb +18 -1
- data/spec/spec_helper.rb +7 -0
- data/upsert.gemspec +1 -0
- metadata +20 -35
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YTE3MDYwZTVkNjkyOWUwOTc4MmNjYTFmOWI4OGNhZjFkYjk5ZjE0YQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MzY5ZDAzZGViY2E5NzQ4NThjOTJiNTg3ZmQ1NTEyMjhmMjRjMjVlNw==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MzZjZjlmYmI4Y2QxZWMxMDAwYTcwMjUwMDc1YTZhMzU3MTA0YTY4MWQzNWE4
|
10
|
+
OWMyZDBlOTVmZGNmNTQzZTQ5MzM4NjgxNTFkNzA0MTNhYzIyYWI0N2VmYTY2
|
11
|
+
MDA1YjQ4NjY3Mzg5NWVjMDQ0YmViMzA2NmM1NDZjNmIxNWM2MGM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MDM2ZTY0YTRlYTVhMmExZGZmMTAyYTEzMjc5YTFmYWVjNjY2MDIxZTg2ODMw
|
14
|
+
YzQ2OWExNmNhNmRjZmQ2YTAxNjdjOTY3NWRhZDQwMjZjNzA2Mzg0NDY0NjBj
|
15
|
+
ZDUzMzhhZjQzNTY5YjE5YmU3NzI0OTkzMTNlZjdmZDg0YjQ4NDE=
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
1.2.0 / 2013-04-04
|
2
|
+
|
3
|
+
* Breaking changes
|
4
|
+
|
5
|
+
* columns named "created_at" and "created_on" will only be set if it's a new row - thanks @derekharmel! https://github.com/seamusabshere/upsert/pull/15
|
6
|
+
|
7
|
+
* Enhancements
|
8
|
+
|
9
|
+
* Detect invalid columns passed in either selector or setter - inspired by @atandrau, thanks! https://github.com/seamusabshere/upsert/issues/18
|
10
|
+
|
11
|
+
* Bug fixes
|
12
|
+
|
13
|
+
* Always convert symbols to strings when used as bind vars - thanks @towerhe! - https://github.com/seamusabshere/upsert/pull/16
|
14
|
+
|
1
15
|
1.1.7 / 2013-01-15
|
2
16
|
|
3
17
|
* Enhancements
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2013 Seamus Abshere
|
2
2
|
|
3
3
|
MIT License
|
4
4
|
|
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
19
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
20
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
21
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -25,9 +25,11 @@ connection = Mysql2::Client.new([...])
|
|
25
25
|
table_name = :pets
|
26
26
|
upsert = Upsert.new connection, table_name
|
27
27
|
# N times...
|
28
|
-
upsert.row({:name => 'Jerry'}, :breed => 'beagle')
|
28
|
+
upsert.row({:name => 'Jerry'}, :breed => 'beagle', :created_at => Time.now)
|
29
29
|
```
|
30
30
|
|
31
|
+
The `created_at` and `created_on` columns are used for inserts, but ignored on updates.
|
32
|
+
|
31
33
|
So just to reiterate you've got a __selector__ and a __setter__:
|
32
34
|
|
33
35
|
```ruby
|
data/lib/upsert.rb
CHANGED
@@ -156,6 +156,7 @@ class Upsert
|
|
156
156
|
'PGConn' => 'PG::Connection',
|
157
157
|
'org.sqlite.Conn' => 'Java::OrgSqliteConn' # for some reason, org.sqlite.Conn doesn't have a ruby class name
|
158
158
|
}
|
159
|
+
CREATED_COL_REGEX = /\Acreated_(at|on)\Z/
|
159
160
|
|
160
161
|
# @return [Upsert::Connection]
|
161
162
|
attr_reader :connection
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class Upsert
|
2
|
+
class ColumnDefinition
|
3
|
+
# @private
|
4
|
+
class Sqlite3 < ColumnDefinition
|
5
|
+
class << self
|
6
|
+
def all(connection, table_name)
|
7
|
+
# activerecord-3.2.13/lib/active_record/connection_adapters/sqlite_adapter.rb
|
8
|
+
connection.execute("PRAGMA table_info(#{connection.quote_ident(table_name)})").map do |row|#, 'SCHEMA').to_hash
|
9
|
+
default = case row["dflt_value"]
|
10
|
+
when /^null$/i
|
11
|
+
nil
|
12
|
+
when /^'(.*)'$/
|
13
|
+
$1.gsub(/''/, "'")
|
14
|
+
when /^"(.*)"$/
|
15
|
+
$1.gsub(/""/, '"')
|
16
|
+
else
|
17
|
+
row["dflt_value"]
|
18
|
+
end
|
19
|
+
new connection, row['name'], row['type'], default
|
20
|
+
end.sort_by do |cd|
|
21
|
+
cd.name
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/upsert/connection.rb
CHANGED
@@ -46,6 +46,7 @@ class Upsert
|
|
46
46
|
@controller = controller
|
47
47
|
@selector_keys = selector_keys
|
48
48
|
@setter_keys = setter_keys
|
49
|
+
validate!
|
49
50
|
create! unless assume_function_exists
|
50
51
|
end
|
51
52
|
|
@@ -68,5 +69,15 @@ class Upsert
|
|
68
69
|
def column_definitions
|
69
70
|
controller.column_definitions
|
70
71
|
end
|
72
|
+
|
73
|
+
private
|
74
|
+
|
75
|
+
def validate!
|
76
|
+
possible = column_definitions.map(&:name)
|
77
|
+
invalid = (setter_keys + selector_keys).uniq - possible
|
78
|
+
if invalid.any?
|
79
|
+
raise ArgumentError, "[Upsert] Invalid column(s): #{invalid.map(&:inspect).join(', ')}"
|
80
|
+
end
|
81
|
+
end
|
71
82
|
end
|
72
83
|
end
|
@@ -22,6 +22,7 @@ class Upsert
|
|
22
22
|
Upsert.logger.info "[upsert] Creating or replacing database function #{name.inspect} on table #{table_name.inspect} for selector #{selector_keys.map(&:inspect).join(', ')} and setter #{setter_keys.map(&:inspect).join(', ')}"
|
23
23
|
selector_column_definitions = column_definitions.select { |cd| selector_keys.include?(cd.name) }
|
24
24
|
setter_column_definitions = column_definitions.select { |cd| setter_keys.include?(cd.name) }
|
25
|
+
update_column_definitions = setter_column_definitions.select { |cd| cd.name !~ CREATED_COL_REGEX }
|
25
26
|
quoted_name = connection.quote_ident name
|
26
27
|
connection.execute "DROP PROCEDURE IF EXISTS #{quoted_name}"
|
27
28
|
connection.execute(%{
|
@@ -50,7 +51,7 @@ class Upsert
|
|
50
51
|
-- key error. But the handler above will take care of that.
|
51
52
|
IF @count > 0 THEN
|
52
53
|
-- UPDATE table_name SET b = b_SET WHERE a = a_SEL;
|
53
|
-
UPDATE #{quoted_table_name} SET #{
|
54
|
+
UPDATE #{quoted_table_name} SET #{update_column_definitions.map(&:to_setter).join(', ')} WHERE #{selector_column_definitions.map(&:to_selector).join(' AND ')};
|
54
55
|
ELSE
|
55
56
|
-- INSERT INTO table_name (a, b) VALUES (k, data);
|
56
57
|
INSERT INTO #{quoted_table_name} (#{setter_column_definitions.map(&:quoted_name).join(', ')}) VALUES (#{setter_column_definitions.map(&:to_setter_value).join(', ')});
|
@@ -53,6 +53,7 @@ class Upsert
|
|
53
53
|
Upsert.logger.info "[upsert] Creating or replacing database function #{name.inspect} on table #{table_name.inspect} for selector #{selector_keys.map(&:inspect).join(', ')} and setter #{setter_keys.map(&:inspect).join(', ')}"
|
54
54
|
selector_column_definitions = column_definitions.select { |cd| selector_keys.include?(cd.name) }
|
55
55
|
setter_column_definitions = column_definitions.select { |cd| setter_keys.include?(cd.name) }
|
56
|
+
update_column_definitions = setter_column_definitions.select { |cd| cd.name !~ CREATED_COL_REGEX }
|
56
57
|
first_try = true
|
57
58
|
connection.execute(%{
|
58
59
|
CREATE OR REPLACE FUNCTION #{name}(#{(selector_column_definitions.map(&:to_selector_arg) + setter_column_definitions.map(&:to_setter_arg)).join(', ')}) RETURNS VOID AS
|
@@ -62,7 +63,7 @@ class Upsert
|
|
62
63
|
BEGIN
|
63
64
|
LOOP
|
64
65
|
-- first try to update the key
|
65
|
-
UPDATE #{quoted_table_name} SET #{
|
66
|
+
UPDATE #{quoted_table_name} SET #{update_column_definitions.map(&:to_setter).join(', ')}
|
66
67
|
WHERE #{selector_column_definitions.map(&:to_selector).join(' AND ') };
|
67
68
|
IF found THEN
|
68
69
|
RETURN;
|
@@ -3,11 +3,13 @@ class Upsert
|
|
3
3
|
# @private
|
4
4
|
module Sqlite3
|
5
5
|
attr_reader :quoted_setter_names
|
6
|
+
attr_reader :quoted_update_names
|
6
7
|
attr_reader :quoted_selector_names
|
7
8
|
|
8
9
|
def initialize(*)
|
9
10
|
super
|
10
11
|
@quoted_setter_names = setter_keys.map { |k| connection.quote_ident k }
|
12
|
+
@quoted_update_names = setter_keys.select { |k| k !~ CREATED_COL_REGEX }.map { |k| connection.quote_ident k }
|
11
13
|
@quoted_selector_names = selector_keys.map { |k| connection.quote_ident k }
|
12
14
|
end
|
13
15
|
|
@@ -18,12 +20,13 @@ class Upsert
|
|
18
20
|
def execute(row)
|
19
21
|
bind_setter_values = row.setter.values.map { |v| connection.bind_value v }
|
20
22
|
bind_selector_values = row.selector.values.map { |v| connection.bind_value v }
|
21
|
-
|
23
|
+
bind_update_values = row.setter.select{ |k,v| k !~ CREATED_COL_REGEX }.map { |k,v| connection.bind_value v }
|
24
|
+
|
22
25
|
insert_or_ignore_sql = %{INSERT OR IGNORE INTO #{quoted_table_name} (#{quoted_setter_names.join(',')}) VALUES (#{Array.new(bind_setter_values.length, '?').join(',')})}
|
23
26
|
connection.execute insert_or_ignore_sql, bind_setter_values
|
24
27
|
|
25
|
-
update_sql = %{UPDATE #{quoted_table_name} SET #{
|
26
|
-
connection.execute update_sql, (
|
28
|
+
update_sql = %{UPDATE #{quoted_table_name} SET #{quoted_update_names.map { |qk| "#{qk}=?" }.join(',')} WHERE #{quoted_selector_names.map { |qk| "#{qk}=?" }.join(' AND ')}}
|
29
|
+
connection.execute update_sql, (bind_update_values + bind_selector_values)
|
27
30
|
end
|
28
31
|
end
|
29
32
|
end
|
data/lib/upsert/version.rb
CHANGED
data/spec/correctness_spec.rb
CHANGED
@@ -46,6 +46,32 @@ describe Upsert do
|
|
46
46
|
u.row(selector, setter)
|
47
47
|
Pet.find_by_name_and_gender('Jerry', 'blue').tag_number.should == 777
|
48
48
|
end
|
49
|
+
|
50
|
+
# https://github.com/seamusabshere/upsert/issues/18
|
51
|
+
it "uses nil selectors" do
|
52
|
+
Pet.create(name: "Jerry", gender: nil, spiel: "samoyed")
|
53
|
+
u = Upsert.new($conn, :pets)
|
54
|
+
u.row({:name => 'Jerry', gender: nil}, :spiel => 'beagle', :birthday => Time.now)
|
55
|
+
Pet.count.should == 1
|
56
|
+
end
|
57
|
+
|
58
|
+
it "uses nil selectors (another way of checking)" do
|
59
|
+
u = Upsert.new($conn, :pets)
|
60
|
+
now = Time.now
|
61
|
+
assert_creates(Pet, [{:name => 'Jerry', :gender => nil, :spiel => 'beagle', :birthday => now}]) do
|
62
|
+
u.row(name: "Jerry", gender: nil, spiel: "samoyed")
|
63
|
+
u.row({:name => 'Jerry', gender: nil}, :spiel => 'beagle', :birthday => Time.now)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
it "tells you if you request a column that doesn't exist" do
|
68
|
+
u = Upsert.new($conn, :pets)
|
69
|
+
lambda { u.row(gibberish: 'ba') }.should raise_error(/invalid col/i)
|
70
|
+
lambda { u.row(name: 'Jerry', gibberish: 'ba') }.should raise_error(/invalid col/i)
|
71
|
+
lambda { u.row({name: 'Jerry'}, gibberish: 'ba') }.should raise_error(/invalid col/i)
|
72
|
+
lambda { u.row({name: 'Jerry'}, gender: 'male', gibberish: 'ba') }.should raise_error(/invalid col/i)
|
73
|
+
end
|
74
|
+
|
49
75
|
end
|
50
76
|
|
51
77
|
describe "is just as correct as other ways" do
|
data/spec/database_spec.rb
CHANGED
@@ -66,6 +66,23 @@ describe Upsert do
|
|
66
66
|
upsert.row({:id => jerry.id}, :lovability => 2.0)
|
67
67
|
end
|
68
68
|
end
|
69
|
+
it "does not set the created_at and created_on columns on update" do
|
70
|
+
task = Task.create :name => 'Clean bathroom'
|
71
|
+
created = task.created_at
|
72
|
+
upsert = Upsert.new $conn, :tasks
|
73
|
+
upsert.row({:id => task.id}, :name => 'Clean kitchen')
|
74
|
+
task.reload
|
75
|
+
task.created_at.should eql task.created_at
|
76
|
+
task.created_on.should eql task.created_on
|
77
|
+
end
|
78
|
+
|
79
|
+
it "converts symbol values to string" do
|
80
|
+
jerry = Pet.create :name => 'Jerry', :gender => 'female'
|
81
|
+
upsert = Upsert.new $conn, :pets
|
82
|
+
assert_creates(Pet, [{:name => 'Jerry', :gender => 'male'}]) do
|
83
|
+
upsert.row({:id => jerry.id}, :gender => :male)
|
84
|
+
end
|
85
|
+
end
|
69
86
|
end
|
70
87
|
describe :batch do
|
71
88
|
it "works for multiple rows (base case)" do
|
@@ -94,4 +111,4 @@ describe Upsert do
|
|
94
111
|
end
|
95
112
|
end
|
96
113
|
end
|
97
|
-
end
|
114
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -107,6 +107,13 @@ class Pet < ActiveRecord::Base
|
|
107
107
|
end
|
108
108
|
Pet.auto_upgrade!
|
109
109
|
|
110
|
+
class Task < ActiveRecord::Base
|
111
|
+
col :name
|
112
|
+
col :created_at, :type => :datetime
|
113
|
+
col :created_on, :type => :datetime
|
114
|
+
end
|
115
|
+
Task.auto_upgrade!
|
116
|
+
|
110
117
|
require 'zlib'
|
111
118
|
require 'benchmark'
|
112
119
|
require 'faker'
|
data/upsert.gemspec
CHANGED
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upsert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Seamus Abshere
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-04-04 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec-core
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ! '>='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rspec-expectations
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ! '>='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ! '>='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rspec-mocks
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ! '>='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ! '>='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: activerecord
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ! '>='
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ! '>='
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: active_record_inline_schema
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ! '>='
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,6 @@ dependencies:
|
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - ! '>='
|
92
81
|
- !ruby/object:Gem::Version
|
@@ -94,7 +83,6 @@ dependencies:
|
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: faker
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
87
|
- - ! '>='
|
100
88
|
- !ruby/object:Gem::Version
|
@@ -102,7 +90,6 @@ dependencies:
|
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
94
|
- - ! '>='
|
108
95
|
- !ruby/object:Gem::Version
|
@@ -110,7 +97,6 @@ dependencies:
|
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: yard
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
101
|
- - ! '>='
|
116
102
|
- !ruby/object:Gem::Version
|
@@ -118,7 +104,6 @@ dependencies:
|
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
108
|
- - ! '>='
|
124
109
|
- !ruby/object:Gem::Version
|
@@ -126,7 +111,6 @@ dependencies:
|
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: activerecord-import
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
115
|
- - ! '>='
|
132
116
|
- !ruby/object:Gem::Version
|
@@ -134,7 +118,6 @@ dependencies:
|
|
134
118
|
type: :development
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
122
|
- - ! '>='
|
140
123
|
- !ruby/object:Gem::Version
|
@@ -142,7 +125,6 @@ dependencies:
|
|
142
125
|
- !ruby/object:Gem::Dependency
|
143
126
|
name: pry
|
144
127
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
128
|
requirements:
|
147
129
|
- - ! '>='
|
148
130
|
- !ruby/object:Gem::Version
|
@@ -150,7 +132,6 @@ dependencies:
|
|
150
132
|
type: :development
|
151
133
|
prerelease: false
|
152
134
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
135
|
requirements:
|
155
136
|
- - ! '>='
|
156
137
|
- !ruby/object:Gem::Version
|
@@ -158,7 +139,6 @@ dependencies:
|
|
158
139
|
- !ruby/object:Gem::Dependency
|
159
140
|
name: pg-hstore
|
160
141
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
142
|
requirements:
|
163
143
|
- - ! '>='
|
164
144
|
- !ruby/object:Gem::Version
|
@@ -166,7 +146,6 @@ dependencies:
|
|
166
146
|
type: :development
|
167
147
|
prerelease: false
|
168
148
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
149
|
requirements:
|
171
150
|
- - ! '>='
|
172
151
|
- !ruby/object:Gem::Version
|
@@ -174,7 +153,6 @@ dependencies:
|
|
174
153
|
- !ruby/object:Gem::Dependency
|
175
154
|
name: sqlite3
|
176
155
|
requirement: !ruby/object:Gem::Requirement
|
177
|
-
none: false
|
178
156
|
requirements:
|
179
157
|
- - ! '>='
|
180
158
|
- !ruby/object:Gem::Version
|
@@ -182,7 +160,6 @@ dependencies:
|
|
182
160
|
type: :development
|
183
161
|
prerelease: false
|
184
162
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
-
none: false
|
186
163
|
requirements:
|
187
164
|
- - ! '>='
|
188
165
|
- !ruby/object:Gem::Version
|
@@ -190,7 +167,6 @@ dependencies:
|
|
190
167
|
- !ruby/object:Gem::Dependency
|
191
168
|
name: mysql2
|
192
169
|
requirement: !ruby/object:Gem::Requirement
|
193
|
-
none: false
|
194
170
|
requirements:
|
195
171
|
- - ! '>='
|
196
172
|
- !ruby/object:Gem::Version
|
@@ -198,7 +174,6 @@ dependencies:
|
|
198
174
|
type: :development
|
199
175
|
prerelease: false
|
200
176
|
version_requirements: !ruby/object:Gem::Requirement
|
201
|
-
none: false
|
202
177
|
requirements:
|
203
178
|
- - ! '>='
|
204
179
|
- !ruby/object:Gem::Version
|
@@ -206,7 +181,6 @@ dependencies:
|
|
206
181
|
- !ruby/object:Gem::Dependency
|
207
182
|
name: pg
|
208
183
|
requirement: !ruby/object:Gem::Requirement
|
209
|
-
none: false
|
210
184
|
requirements:
|
211
185
|
- - ! '>='
|
212
186
|
- !ruby/object:Gem::Version
|
@@ -214,7 +188,6 @@ dependencies:
|
|
214
188
|
type: :development
|
215
189
|
prerelease: false
|
216
190
|
version_requirements: !ruby/object:Gem::Requirement
|
217
|
-
none: false
|
218
191
|
requirements:
|
219
192
|
- - ! '>='
|
220
193
|
- !ruby/object:Gem::Version
|
@@ -222,7 +195,6 @@ dependencies:
|
|
222
195
|
- !ruby/object:Gem::Dependency
|
223
196
|
name: redcarpet
|
224
197
|
requirement: !ruby/object:Gem::Requirement
|
225
|
-
none: false
|
226
198
|
requirements:
|
227
199
|
- - ! '>='
|
228
200
|
- !ruby/object:Gem::Version
|
@@ -230,7 +202,20 @@ dependencies:
|
|
230
202
|
type: :development
|
231
203
|
prerelease: false
|
232
204
|
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
|
205
|
+
requirements:
|
206
|
+
- - ! '>='
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: rake
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ! '>='
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
234
219
|
requirements:
|
235
220
|
- - ! '>='
|
236
221
|
- !ruby/object:Gem::Version
|
@@ -256,6 +241,7 @@ files:
|
|
256
241
|
- lib/upsert/column_definition.rb
|
257
242
|
- lib/upsert/column_definition/mysql.rb
|
258
243
|
- lib/upsert/column_definition/postgresql.rb
|
244
|
+
- lib/upsert/column_definition/sqlite3.rb
|
259
245
|
- lib/upsert/connection.rb
|
260
246
|
- lib/upsert/connection/Java_ComMysqlJdbc_JDBC4Connection.rb
|
261
247
|
- lib/upsert/connection/Java_OrgPostgresqlJdbc4_Jdbc4Connection.rb
|
@@ -299,27 +285,26 @@ files:
|
|
299
285
|
- upsert.gemspec
|
300
286
|
homepage: https://github.com/seamusabshere/upsert
|
301
287
|
licenses: []
|
288
|
+
metadata: {}
|
302
289
|
post_install_message:
|
303
290
|
rdoc_options: []
|
304
291
|
require_paths:
|
305
292
|
- lib
|
306
293
|
required_ruby_version: !ruby/object:Gem::Requirement
|
307
|
-
none: false
|
308
294
|
requirements:
|
309
295
|
- - ! '>='
|
310
296
|
- !ruby/object:Gem::Version
|
311
297
|
version: '0'
|
312
298
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
313
|
-
none: false
|
314
299
|
requirements:
|
315
300
|
- - ! '>='
|
316
301
|
- !ruby/object:Gem::Version
|
317
302
|
version: '0'
|
318
303
|
requirements: []
|
319
304
|
rubyforge_project:
|
320
|
-
rubygems_version:
|
305
|
+
rubygems_version: 2.0.3
|
321
306
|
signing_key:
|
322
|
-
specification_version:
|
307
|
+
specification_version: 4
|
323
308
|
summary: Make it easy to upsert on MySQL, PostgreSQL, and SQLite3. Transparently creates
|
324
309
|
merge functions for MySQL and PostgreSQL; on SQLite3, uses INSERT OR IGNORE.
|
325
310
|
test_files:
|