wikk_sql 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/lib/wikk_sql.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e79080d1dcb41aeef5ff6185476cc3391f0e63d8
|
4
|
+
data.tar.gz: 58b2c77cf999e3fa72d4ac8adcf6ef2512a84061
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10fe03396296a531bbeeee1ded2e4352f4aaf2bbd6b5ab1ac32f7d08d525516df5c638b8b64ba1d9c5d64813c4253818c496566490e99744fdaec7b862fe6572
|
7
|
+
data.tar.gz: 67fe12be20fa3417ef08d5c043b4d1c7003a3605b7f3cfabe080a3ca25e82b57099364680ea61870d7d6fc2e5a0da54f0985f78cb7f613e7ac10e098193232ed
|
data/lib/wikk_sql.rb
CHANGED
@@ -8,7 +8,7 @@ module WIKK
|
|
8
8
|
# @attr_reader [Mysql::Result] result the last query's result
|
9
9
|
# @attr_reader [Mysql] my the DB connection descriptor
|
10
10
|
class SQL
|
11
|
-
VERSION = '0.1.
|
11
|
+
VERSION = '0.1.4'
|
12
12
|
|
13
13
|
attr_reader :affected_rows, :result, :my
|
14
14
|
|
@@ -45,6 +45,7 @@ module WIKK
|
|
45
45
|
@my = nil
|
46
46
|
raise e
|
47
47
|
end
|
48
|
+
raise Mysql::Error, 'Not Connected' if @my == nil
|
48
49
|
#@@my.reconnect = true
|
49
50
|
if block_given?
|
50
51
|
yield
|
@@ -68,6 +69,7 @@ module WIKK
|
|
68
69
|
# @yieldparam [Mysql::Result] @result and @affected_rows are also set.
|
69
70
|
# @return [Mysql::Result] @result and @affected_rows are also set.
|
70
71
|
def query(the_query)
|
72
|
+
raise Mysql::Error, 'Not Connected' if @my == nil
|
71
73
|
begin
|
72
74
|
if @result != nil
|
73
75
|
@result.free #Free any result we had left over from previous use.
|
@@ -95,7 +97,7 @@ module WIKK
|
|
95
97
|
# @yieldparam [] yields to block, where the queries are performed.
|
96
98
|
# @raise [Mysql] passes on Mysql errors, freeing the result.
|
97
99
|
def transaction
|
98
|
-
|
100
|
+
raise Mysql::Error, 'Not Connected' if @my == nil
|
99
101
|
if block_given?
|
100
102
|
begin
|
101
103
|
@my.query("START TRANSACTION WITH CONSISTENT SNAPSHOT")
|