dohmysql 0.2.23 → 0.2.24

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 (37) hide show
  1. data/bin/makedb +3 -3
  2. data/bin/migrate +5 -4
  3. data/lib/{doh/mysql → dohmysql}/abstract_row.rb +1 -1
  4. data/lib/{doh/mysql → dohmysql}/cache_connector.rb +1 -1
  5. data/lib/{doh/mysql → dohmysql}/current_date.rb +2 -2
  6. data/lib/{doh/mysql → dohmysql}/database_creator.rb +4 -4
  7. data/lib/{doh/mysql → dohmysql}/db_date.rb +1 -1
  8. data/lib/{doh/mysql → dohmysql}/handle.rb +10 -8
  9. data/lib/{doh/mysql → dohmysql}/load_sql.rb +1 -1
  10. data/lib/{doh/mysql → dohmysql}/metadata_util.rb +1 -1
  11. data/lib/{doh/mysql → dohmysql}/migrate/analyzer.rb +2 -2
  12. data/lib/{doh/mysql → dohmysql}/migrate/runner.rb +1 -1
  13. data/lib/{doh/mysql → dohmysql}/raw_row_builder.rb +1 -1
  14. data/lib/{doh/mysql → dohmysql}/readonly_row.rb +1 -1
  15. data/lib/{doh/mysql → dohmysql}/smart_row.rb +1 -1
  16. data/lib/{doh/mysql → dohmysql}/typed_row_builder.rb +1 -1
  17. data/lib/{doh/mysql → dohmysql}/writable_row.rb +2 -2
  18. data/lib/dohmysql.rb +5 -0
  19. data/test/cache_connector.dt.rb +1 -1
  20. data/test/connector_instance.dt.rb +1 -1
  21. data/test/db_date.dt.rb +2 -2
  22. data/test/handle.dt.rb +6 -7
  23. data/test/helpers.rb +3 -3
  24. data/test/metadata_util.dt.rb +1 -1
  25. data/test/readonly_row.dt.rb +1 -1
  26. data/test/to_sql.dt.rb +1 -1
  27. data/test/writable_row.dt.rb +1 -1
  28. metadata +32 -32
  29. data/lib/doh/mysql.rb +0 -5
  30. /data/lib/{doh/mysql → dohmysql}/connector_instance.rb +0 -0
  31. /data/lib/{doh/mysql → dohmysql}/connector_util.rb +0 -0
  32. /data/lib/{doh/mysql → dohmysql}/error.rb +0 -0
  33. /data/lib/{doh/mysql → dohmysql}/file_util.rb +0 -0
  34. /data/lib/{doh/mysql → dohmysql}/hash_row.rb +0 -0
  35. /data/lib/{doh/mysql → dohmysql}/logger.rb +0 -0
  36. /data/lib/{doh/mysql → dohmysql}/migrate/options.rb +0 -0
  37. /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 'doh/app/init_from_pwd'
3
- require 'doh/options'
4
- require 'doh/mysql/database_creator'
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 'doh/app/cli'
3
- require 'doh/mysql/migrate/runner'
4
- require 'doh/mysql/migrate/analyzer'
5
- require 'doh/mysql/migrate/options'
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,4 +1,4 @@
1
- require 'doh/core_ext/force_deep_copy'
1
+ require 'dohutil/core_ext/force_deep_copy'
2
2
 
3
3
  module DohDb
4
4
 
@@ -1,5 +1,5 @@
1
1
  require 'dohlog'
2
- require 'doh/mysql/handle'
2
+ require 'dohmysql/handle'
3
3
 
4
4
  module DohDb
5
5
 
@@ -1,5 +1,5 @@
1
- require 'doh/current_date'
2
- require 'doh/mysql/db_date'
1
+ require 'dohutil/current_date'
2
+ require 'dohmysql/db_date'
3
3
 
4
4
  module DohDb
5
5
 
@@ -1,8 +1,8 @@
1
- require 'doh/core_ext/dir'
2
- require 'doh/mysql/handle'
3
- require 'doh/mysql/load_sql'
1
+ require 'dohutil/core_ext/dir'
2
+ require 'dohmysql/handle'
3
+ require 'dohmysql/load_sql'
4
4
  require 'yaml'
5
- require 'doh/mysql/file_util'
5
+ require 'dohmysql/file_util'
6
6
 
7
7
  module DohDb
8
8
 
@@ -1,4 +1,4 @@
1
- require 'doh/core_ext/datewithtime'
1
+ require 'dohutil/core_ext/datewithtime'
2
2
 
3
3
  module DohDb
4
4
 
@@ -1,12 +1,12 @@
1
1
  require 'mysql2'
2
- require 'doh/array_to_hash'
3
- require 'doh/mysql/logger'
4
- require 'doh/mysql/error'
5
- require 'doh/mysql/typed_row_builder'
6
- require 'doh/mysql/writable_row'
7
- require 'doh/mysql/hash_row'
8
- require 'doh/mysql/smart_row'
9
- require 'doh/mysql/to_sql'
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)
@@ -1,4 +1,4 @@
1
- require 'doh/mysql/connector_instance'
1
+ require 'dohmysql/connector_instance'
2
2
  require 'open3'
3
3
 
4
4
  module DohDb
@@ -1,4 +1,4 @@
1
- require 'doh/mysql/connector_instance'
1
+ require 'dohmysql/connector_instance'
2
2
 
3
3
  module DohDb
4
4
 
@@ -1,5 +1,5 @@
1
- require 'doh/mysql/migrate/runner'
2
- require 'doh/mysql/database_creator'
1
+ require 'dohmysql/migrate/runner'
2
+ require 'dohmysql/database_creator'
3
3
  require 'open3'
4
4
 
5
5
  module DohDb
@@ -1,4 +1,4 @@
1
- require 'doh/mysql/load_sql'
1
+ require 'dohmysql/load_sql'
2
2
 
3
3
  module DohDb
4
4
 
@@ -1,4 +1,4 @@
1
- require 'doh/mysql/readonly_row'
1
+ require 'dohmysql/readonly_row'
2
2
 
3
3
  module DohDb
4
4
 
@@ -1,4 +1,4 @@
1
- require 'doh/mysql/abstract_row'
1
+ require 'dohmysql/abstract_row'
2
2
 
3
3
  module DohDb
4
4
 
@@ -1,4 +1,4 @@
1
- require 'doh/mysql/abstract_row'
1
+ require 'dohmysql/abstract_row'
2
2
 
3
3
  module DohDb
4
4
 
@@ -1,4 +1,4 @@
1
- require 'doh/mysql/readonly_row'
1
+ require 'dohmysql/readonly_row'
2
2
 
3
3
  module DohDb
4
4
 
@@ -1,5 +1,5 @@
1
- require 'doh/core_ext/string'
2
- require 'doh/mysql/abstract_row'
1
+ require 'dohutil/core_ext/string'
2
+ require 'dohmysql/abstract_row'
3
3
  require 'set'
4
4
 
5
5
  module DohDb
data/lib/dohmysql.rb ADDED
@@ -0,0 +1,5 @@
1
+ require 'dohmysql/cache_connector'
2
+ require 'dohmysql/connector_instance'
3
+ require 'dohmysql/handle'
4
+ require 'dohmysql/to_sql'
5
+ require 'dohmysql/db_date'
@@ -1,4 +1,4 @@
1
- require 'doh/mysql/cache_connector'
1
+ require 'dohmysql/cache_connector'
2
2
  require_relative 'helpers'
3
3
 
4
4
  module DohDb
@@ -1,4 +1,4 @@
1
- require 'doh/mysql/connector_instance'
1
+ require 'dohmysql/connector_instance'
2
2
  require_relative 'helpers'
3
3
 
4
4
  module DohDb
data/test/db_date.dt.rb CHANGED
@@ -1,5 +1,5 @@
1
- require 'doh/mysql/db_date'
2
- require 'doh/mysql/to_sql'
1
+ require 'dohmysql/db_date'
2
+ require 'dohmysql/to_sql'
3
3
 
4
4
  module DohDb
5
5
 
data/test/handle.dt.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require_relative 'helpers'
2
- require 'doh/mysql/handle'
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 'doh/mysql/handle'
19
+ require 'dohmysql/handle'
20
20
  DohDb::Handle.new(dbcfg)
21
21
  end
22
22
 
23
23
  def init_global_connector
24
- require 'doh/mysql/connector_instance'
25
- require 'doh/mysql/cache_connector'
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
@@ -1,5 +1,5 @@
1
1
  require_relative 'helpers'
2
- require 'doh/mysql/metadata_util'
2
+ require 'dohmysql/metadata_util'
3
3
 
4
4
  module DohDb
5
5
 
@@ -1,4 +1,4 @@
1
- require 'doh/mysql/readonly_row'
1
+ require 'dohmysql/readonly_row'
2
2
 
3
3
  module DohDb
4
4
 
data/test/to_sql.dt.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'doh/mysql/to_sql'
1
+ require 'dohmysql/to_sql'
2
2
 
3
3
  module DohDb
4
4
 
@@ -1,4 +1,4 @@
1
- require 'doh/mysql/writable_row'
1
+ require 'dohmysql/writable_row'
2
2
 
3
3
  module DohDb
4
4
 
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.23
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-21 00:00:00.000000000 Z
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.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.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.9
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.9
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.15
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.15
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/doh/mysql/abstract_row.rb
124
- - lib/doh/mysql/cache_connector.rb
125
- - lib/doh/mysql/connector_instance.rb
126
- - lib/doh/mysql/connector_util.rb
127
- - lib/doh/mysql/current_date.rb
128
- - lib/doh/mysql/database_creator.rb
129
- - lib/doh/mysql/db_date.rb
130
- - lib/doh/mysql/error.rb
131
- - lib/doh/mysql/file_util.rb
132
- - lib/doh/mysql/handle.rb
133
- - lib/doh/mysql/hash_row.rb
134
- - lib/doh/mysql/load_sql.rb
135
- - lib/doh/mysql/logger.rb
136
- - lib/doh/mysql/metadata_util.rb
137
- - lib/doh/mysql/migrate/analyzer.rb
138
- - lib/doh/mysql/migrate/options.rb
139
- - lib/doh/mysql/migrate/runner.rb
140
- - lib/doh/mysql/raw_row_builder.rb
141
- - lib/doh/mysql/readonly_row.rb
142
- - lib/doh/mysql/smart_row.rb
143
- - lib/doh/mysql/to_sql.rb
144
- - lib/doh/mysql/typed_row_builder.rb
145
- - lib/doh/mysql/writable_row.rb
146
- - lib/doh/mysql.rb
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
@@ -1,5 +0,0 @@
1
- require 'doh/mysql/cache_connector'
2
- require 'doh/mysql/connector_instance'
3
- require 'doh/mysql/handle'
4
- require 'doh/mysql/to_sql'
5
- require 'doh/mysql/db_date'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes