fluiddb 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/FluidDb/TinyTds.rb +7 -9
- metadata +2 -2
data/lib/FluidDb/TinyTds.rb
CHANGED
@@ -10,15 +10,13 @@ module FluidDb
|
|
10
10
|
# @param [String] uri a location for the resource to which we will attach, eg tinytds://user:pass@127.0.0.1
|
11
11
|
def connect()
|
12
12
|
uri = @uri
|
13
|
-
raise "Unsupported uri. Please update freetds.conf and use format tinytds://<user>:<pass>@<dataserver>" unless uri.path == ""
|
14
13
|
|
15
14
|
dataserver = uri.host
|
16
|
-
|
15
|
+
database = uri.path.sub( "/", "" )
|
16
|
+
username = URI.unescape( uri.user )
|
17
17
|
password = uri.password
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
@connection = ::TinyTds::Client.new( :username => username, :password => password, :dataserver => dataserver )
|
19
|
+
@connection = ::TinyTds::Client.new( :username => username, :password => password, :database => database, :dataserver => dataserver )
|
22
20
|
end
|
23
21
|
|
24
22
|
def close
|
@@ -27,8 +25,8 @@ module FluidDb
|
|
27
25
|
|
28
26
|
def queryForArray( sql, params )
|
29
27
|
sql = self.format_to_sql( sql, params )
|
30
|
-
results = @connection.
|
31
|
-
|
28
|
+
results = @connection.execute(sql)
|
29
|
+
|
32
30
|
count = 0
|
33
31
|
tuple = ""
|
34
32
|
results.each do |row|
|
@@ -45,7 +43,7 @@ module FluidDb
|
|
45
43
|
|
46
44
|
def queryForValue( sql, params )
|
47
45
|
sql = self.format_to_sql( sql, params )
|
48
|
-
results = @connection.
|
46
|
+
results = @connection.execute(sql)
|
49
47
|
|
50
48
|
count = 0
|
51
49
|
value = ""
|
@@ -64,7 +62,7 @@ module FluidDb
|
|
64
62
|
|
65
63
|
def queryForResultset( sql, params )
|
66
64
|
sql = self.format_to_sql( sql, params )
|
67
|
-
results = @connection.
|
65
|
+
results = @connection.execute(sql)
|
68
66
|
|
69
67
|
list = Array.new
|
70
68
|
results.each do |row|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluiddb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A semantic layer for db interaction
|
15
15
|
email: guy@guyirvine.com
|