wikk_sql 0.1.2 → 0.1.3
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/History.txt +16 -0
- data/lib/wikk_sql.rb +10 -5
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24ae4136e9b1d2294d3a2f450cf28dc937240fc3
|
4
|
+
data.tar.gz: f51eabc9c1f8efe8c93d3c9315877d30a0e2cb4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7c9abebe4e35e9f1911be665e755bc2714d06d45cfc57909f7b7b3c8fa1538d9f3fc2cf87a044853733ade99a3616d5358264675070934ede25cd910ec4d7e9
|
7
|
+
data.tar.gz: 4597cc3055cd996a8dc7554f9c84dc785e4e1e71905b5712e9fa48bcc1d645859a52887a9edcfe3db9106664881bd18b696bba7c6db6fa801677074a1e8aa637
|
data/History.txt
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
robertburrowes Wed Jan 4 16:49:28 2017 +1300
|
2
|
+
set @affected_rows before query :(
|
3
|
+
robertburrowes Tue Jun 28 22:39:37 2016 +1200
|
4
|
+
added auto git tagging on release
|
5
|
+
robertburrowes Sun Jun 19 14:58:57 2016 +1200
|
6
|
+
Put Wikk Configuration class into module WIKK
|
7
|
+
robertburrowes Sun Jun 19 14:54:48 2016 +1200
|
8
|
+
Acknowledge code origin
|
9
|
+
robertburrowes Sun Jun 19 14:50:56 2016 +1200
|
10
|
+
Tidied up inline documentation of class
|
11
|
+
robertburrowes Sun Jun 19 14:50:30 2016 +1200
|
12
|
+
Ensured history file generated before package is generated
|
13
|
+
robertburrowes Sun Jun 19 14:50:07 2016 +1200
|
14
|
+
Upped version
|
15
|
+
robertburrowes Sun Jun 19 14:49:52 2016 +1200
|
16
|
+
Changed WIKK_SQL to module WIKK::SQL
|
1
17
|
robertburrowes Sun Jun 19 14:01:08 2016 +1200
|
2
18
|
Encapsulation of SQL into module WIKK
|
3
19
|
robertburrowes Sun Jun 19 13:59:27 2016 +1200
|
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.3'
|
12
12
|
|
13
13
|
attr_reader :affected_rows, :result, :my
|
14
14
|
|
@@ -39,7 +39,12 @@ module WIKK
|
|
39
39
|
db_config = Struct.new(*(k = sym.keys)).new(*sym.values_at(*k))
|
40
40
|
end
|
41
41
|
|
42
|
-
|
42
|
+
begin
|
43
|
+
@my = Mysql::new(db_config.host, db_config.dbuser, db_config.key, db_config.db )
|
44
|
+
rescue Exception => e
|
45
|
+
@my = nil
|
46
|
+
raise e
|
47
|
+
end
|
43
48
|
#@@my.reconnect = true
|
44
49
|
if block_given?
|
45
50
|
yield
|
@@ -64,7 +69,7 @@ module WIKK
|
|
64
69
|
# @return [Mysql::Result] @result and @affected_rows are also set.
|
65
70
|
def query(the_query)
|
66
71
|
begin
|
67
|
-
if result != nil
|
72
|
+
if @result != nil
|
68
73
|
@result.free #Free any result we had left over from previous use.
|
69
74
|
@result = nil
|
70
75
|
end
|
@@ -77,7 +82,7 @@ module WIKK
|
|
77
82
|
return @result
|
78
83
|
end
|
79
84
|
rescue Mysql::Error => e
|
80
|
-
if result != nil
|
85
|
+
if @result != nil
|
81
86
|
@result.free #Free any result we had left over from previous use.
|
82
87
|
@result = nil
|
83
88
|
end
|
@@ -90,7 +95,7 @@ module WIKK
|
|
90
95
|
# @yieldparam [] yields to block, where the queries are performed.
|
91
96
|
# @raise [Mysql] passes on Mysql errors, freeing the result.
|
92
97
|
def transaction
|
93
|
-
puts "transaction"
|
98
|
+
#puts "transaction"
|
94
99
|
if block_given?
|
95
100
|
begin
|
96
101
|
@my.query("START TRANSACTION WITH CONSISTENT SNAPSHOT")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wikk_sql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Burrowes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hoe-yard
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.3
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
26
|
+
version: 0.1.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: hoe
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '3.
|
33
|
+
version: '3.16'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '3.
|
40
|
+
version: '3.16'
|
41
41
|
description: "```"
|
42
42
|
email:
|
43
43
|
- r.burrowes@auckland.ac.nz
|