dohmysql 0.2.23 → 0.2.24
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/makedb +3 -3
- data/bin/migrate +5 -4
- data/lib/{doh/mysql → dohmysql}/abstract_row.rb +1 -1
- data/lib/{doh/mysql → dohmysql}/cache_connector.rb +1 -1
- data/lib/{doh/mysql → dohmysql}/current_date.rb +2 -2
- data/lib/{doh/mysql → dohmysql}/database_creator.rb +4 -4
- data/lib/{doh/mysql → dohmysql}/db_date.rb +1 -1
- data/lib/{doh/mysql → dohmysql}/handle.rb +10 -8
- data/lib/{doh/mysql → dohmysql}/load_sql.rb +1 -1
- data/lib/{doh/mysql → dohmysql}/metadata_util.rb +1 -1
- data/lib/{doh/mysql → dohmysql}/migrate/analyzer.rb +2 -2
- data/lib/{doh/mysql → dohmysql}/migrate/runner.rb +1 -1
- data/lib/{doh/mysql → dohmysql}/raw_row_builder.rb +1 -1
- data/lib/{doh/mysql → dohmysql}/readonly_row.rb +1 -1
- data/lib/{doh/mysql → dohmysql}/smart_row.rb +1 -1
- data/lib/{doh/mysql → dohmysql}/typed_row_builder.rb +1 -1
- data/lib/{doh/mysql → dohmysql}/writable_row.rb +2 -2
- data/lib/dohmysql.rb +5 -0
- data/test/cache_connector.dt.rb +1 -1
- data/test/connector_instance.dt.rb +1 -1
- data/test/db_date.dt.rb +2 -2
- data/test/handle.dt.rb +6 -7
- data/test/helpers.rb +3 -3
- data/test/metadata_util.dt.rb +1 -1
- data/test/readonly_row.dt.rb +1 -1
- data/test/to_sql.dt.rb +1 -1
- data/test/writable_row.dt.rb +1 -1
- metadata +32 -32
- data/lib/doh/mysql.rb +0 -5
- /data/lib/{doh/mysql → dohmysql}/connector_instance.rb +0 -0
- /data/lib/{doh/mysql → dohmysql}/connector_util.rb +0 -0
- /data/lib/{doh/mysql → dohmysql}/error.rb +0 -0
- /data/lib/{doh/mysql → dohmysql}/file_util.rb +0 -0
- /data/lib/{doh/mysql → dohmysql}/hash_row.rb +0 -0
- /data/lib/{doh/mysql → dohmysql}/logger.rb +0 -0
- /data/lib/{doh/mysql → dohmysql}/migrate/options.rb +0 -0
- /data/lib/{doh/mysql → dohmysql}/to_sql.rb +0 -0
data/bin/makedb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require '
|
3
|
-
require '
|
4
|
-
require '
|
2
|
+
require 'dohutil/app/init_from_pwd'
|
3
|
+
require 'dohroot/options'
|
4
|
+
require 'dohmysql/database_creator'
|
5
5
|
|
6
6
|
opts = Doh::Options.new(
|
7
7
|
{'drop_first' => [false, "-z", "--drop_first", "if true, will drop the database or tables before creating"] \
|
data/bin/migrate
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require '
|
3
|
-
require '
|
4
|
-
require '
|
5
|
-
require '
|
2
|
+
require 'dohutil/app/cli'
|
3
|
+
require 'dohmysql/migrate/runner'
|
4
|
+
require 'dohmysql/migrate/analyzer'
|
5
|
+
require 'dohmysql/migrate/options'
|
6
|
+
|
6
7
|
module DohDb
|
7
8
|
module Migrate
|
8
9
|
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
3
|
-
require '
|
1
|
+
require 'dohutil/core_ext/dir'
|
2
|
+
require 'dohmysql/handle'
|
3
|
+
require 'dohmysql/load_sql'
|
4
4
|
require 'yaml'
|
5
|
-
require '
|
5
|
+
require 'dohmysql/file_util'
|
6
6
|
|
7
7
|
module DohDb
|
8
8
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'mysql2'
|
2
|
-
require '
|
3
|
-
require '
|
4
|
-
require '
|
5
|
-
require '
|
6
|
-
require '
|
7
|
-
require '
|
8
|
-
require '
|
9
|
-
require '
|
2
|
+
require 'dohutil/array_to_hash'
|
3
|
+
require 'dohmysql/logger'
|
4
|
+
require 'dohmysql/error'
|
5
|
+
require 'dohmysql/typed_row_builder'
|
6
|
+
require 'dohmysql/writable_row'
|
7
|
+
require 'dohmysql/hash_row'
|
8
|
+
require 'dohmysql/smart_row'
|
9
|
+
require 'dohmysql/to_sql'
|
10
10
|
Mysql2::Client.default_query_options[:cast_booleans] = true
|
11
11
|
|
12
12
|
module DohDb
|
@@ -214,6 +214,8 @@ private
|
|
214
214
|
end
|
215
215
|
|
216
216
|
def insert_hashes_helper(hashes, table, keyword, quote_strings)
|
217
|
+
return if hashes.empty?
|
218
|
+
|
217
219
|
valuestrs = []
|
218
220
|
keys = hashes[0].keys
|
219
221
|
keystr = get_key_insert_str(keys)
|
data/lib/dohmysql.rb
ADDED
data/test/cache_connector.dt.rb
CHANGED
data/test/db_date.dt.rb
CHANGED
data/test/handle.dt.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require_relative 'helpers'
|
2
|
-
require '
|
2
|
+
require 'dohmysql/handle'
|
3
3
|
|
4
4
|
module DohDb
|
5
5
|
|
@@ -52,17 +52,16 @@ class Test_Handle < DohTest::TestGroup
|
|
52
52
|
dbh = get_dbh
|
53
53
|
dbh.query("CREATE TEMPORARY TABLE #{tbl} (value INT KEY)")
|
54
54
|
hash1 = {'value' => 1}
|
55
|
-
hash2 = {'value' => 2}
|
56
|
-
hash3 = {'value' => 3}
|
57
|
-
hash4 = {'value' => 4}
|
58
55
|
assert_equal(0, dbh.insert_hash(hash1, tbl))
|
59
56
|
assert_equal(0, dbh.insert_ignore_hash(hash1, tbl))
|
60
|
-
assert_equal(1, dbh.select_field("SELECT COUNT(*) from #{tbl}"))
|
61
|
-
assert_equal(0, dbh.insert_hashes([hash2, hash3, hash4], tbl))
|
62
|
-
assert_equal(4, dbh.select_field("SELECT COUNT(*) from #{tbl}"))
|
63
57
|
assert_raises(Mysql2::Error) { dbh.insert_hash(hash1, tbl) }
|
64
58
|
end
|
65
59
|
|
60
|
+
def test_insert_hashes
|
61
|
+
dbh = get_dbh
|
62
|
+
dbh.insert_hashes([], '')
|
63
|
+
end
|
64
|
+
|
66
65
|
def test_bad_handle_reconnect
|
67
66
|
dbh = get_dbh
|
68
67
|
begin
|
data/test/helpers.rb
CHANGED
@@ -16,13 +16,13 @@ module InternalTestHelpers
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def get_dbh
|
19
|
-
require '
|
19
|
+
require 'dohmysql/handle'
|
20
20
|
DohDb::Handle.new(dbcfg)
|
21
21
|
end
|
22
22
|
|
23
23
|
def init_global_connector
|
24
|
-
require '
|
25
|
-
require '
|
24
|
+
require 'dohmysql/connector_instance'
|
25
|
+
require 'dohmysql/cache_connector'
|
26
26
|
DohDb.set_connector_instance(DohDb::CacheConnector.new(dbcfg))
|
27
27
|
end
|
28
28
|
end
|
data/test/metadata_util.dt.rb
CHANGED
data/test/readonly_row.dt.rb
CHANGED
data/test/to_sql.dt.rb
CHANGED
data/test/writable_row.dt.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dohmysql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.24
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-05-
|
13
|
+
date: 2013-05-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: dohroot
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.1.
|
22
|
+
version: 0.1.2
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,7 +27,7 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - ! '>='
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0.1.
|
30
|
+
version: 0.1.2
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: dohutil
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
@@ -83,7 +83,7 @@ dependencies:
|
|
83
83
|
requirements:
|
84
84
|
- - ! '>='
|
85
85
|
- !ruby/object:Gem::Version
|
86
|
-
version: 0.1.
|
86
|
+
version: 0.1.11
|
87
87
|
type: :runtime
|
88
88
|
prerelease: false
|
89
89
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -91,7 +91,7 @@ dependencies:
|
|
91
91
|
requirements:
|
92
92
|
- - ! '>='
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version: 0.1.
|
94
|
+
version: 0.1.11
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
name: dohtest
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -99,7 +99,7 @@ dependencies:
|
|
99
99
|
requirements:
|
100
100
|
- - ! '>='
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 0.1.
|
102
|
+
version: 0.1.19
|
103
103
|
type: :development
|
104
104
|
prerelease: false
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -107,7 +107,7 @@ dependencies:
|
|
107
107
|
requirements:
|
108
108
|
- - ! '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.1.
|
110
|
+
version: 0.1.19
|
111
111
|
description: wrapper classes around low level mysql gem to provide a better interface
|
112
112
|
email:
|
113
113
|
- devinfo@atpsoft.com
|
@@ -120,30 +120,30 @@ extra_rdoc_files:
|
|
120
120
|
files:
|
121
121
|
- bin/makedb
|
122
122
|
- bin/migrate
|
123
|
-
- lib/
|
124
|
-
- lib/
|
125
|
-
- lib/
|
126
|
-
- lib/
|
127
|
-
- lib/
|
128
|
-
- lib/
|
129
|
-
- lib/
|
130
|
-
- lib/
|
131
|
-
- lib/
|
132
|
-
- lib/
|
133
|
-
- lib/
|
134
|
-
- lib/
|
135
|
-
- lib/
|
136
|
-
- lib/
|
137
|
-
- lib/
|
138
|
-
- lib/
|
139
|
-
- lib/
|
140
|
-
- lib/
|
141
|
-
- lib/
|
142
|
-
- lib/
|
143
|
-
- lib/
|
144
|
-
- lib/
|
145
|
-
- lib/
|
146
|
-
- lib/
|
123
|
+
- lib/dohmysql/abstract_row.rb
|
124
|
+
- lib/dohmysql/cache_connector.rb
|
125
|
+
- lib/dohmysql/connector_instance.rb
|
126
|
+
- lib/dohmysql/connector_util.rb
|
127
|
+
- lib/dohmysql/current_date.rb
|
128
|
+
- lib/dohmysql/database_creator.rb
|
129
|
+
- lib/dohmysql/db_date.rb
|
130
|
+
- lib/dohmysql/error.rb
|
131
|
+
- lib/dohmysql/file_util.rb
|
132
|
+
- lib/dohmysql/handle.rb
|
133
|
+
- lib/dohmysql/hash_row.rb
|
134
|
+
- lib/dohmysql/load_sql.rb
|
135
|
+
- lib/dohmysql/logger.rb
|
136
|
+
- lib/dohmysql/metadata_util.rb
|
137
|
+
- lib/dohmysql/migrate/analyzer.rb
|
138
|
+
- lib/dohmysql/migrate/options.rb
|
139
|
+
- lib/dohmysql/migrate/runner.rb
|
140
|
+
- lib/dohmysql/raw_row_builder.rb
|
141
|
+
- lib/dohmysql/readonly_row.rb
|
142
|
+
- lib/dohmysql/smart_row.rb
|
143
|
+
- lib/dohmysql/to_sql.rb
|
144
|
+
- lib/dohmysql/typed_row_builder.rb
|
145
|
+
- lib/dohmysql/writable_row.rb
|
146
|
+
- lib/dohmysql.rb
|
147
147
|
- test/cache_connector.dt.rb
|
148
148
|
- test/connector_instance.dt.rb
|
149
149
|
- test/db_date.dt.rb
|
data/lib/doh/mysql.rb
DELETED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|