fluiddb 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/lib/FluidDb.rb CHANGED
@@ -2,6 +2,8 @@ require 'date'
2
2
  require 'time'
3
3
  require 'uri'
4
4
 
5
+ require "FluidDb/Db"
6
+
5
7
  module FluidDb
6
8
 
7
9
  class ConnectionError<StandardError
data/lib/FluidDb/Db.rb ADDED
@@ -0,0 +1,25 @@
1
+ require "FluidDb"
2
+
3
+ module FluidDb
4
+
5
+ def FluidDb.Db( uri )
6
+
7
+ case uri.scheme
8
+ when "mysql"
9
+ require "FluidDb/Mysql"
10
+ return FluidDb::Mysql.new( uri )
11
+ when "mysql2"
12
+ require "FluidDb/Mysql2"
13
+ return FluidDb::Mysql2.new( uri )
14
+ when "pgsql"
15
+ require "FluidDb/Pgsql"
16
+ return FluidDb::Pgsql.new( uri )
17
+ when "mock"
18
+ require "FluidDb/Mock"
19
+ return FluidDb::Mock.new( uri )
20
+ else
21
+ abort("Scheme, #{uri.scheme}, not recognised when configuring creating db connection");
22
+ end
23
+
24
+ end
25
+ end
data/lib/FluidDb/Mysql.rb CHANGED
@@ -18,7 +18,7 @@ module FluidDb
18
18
  def close
19
19
  @connection.close
20
20
  end
21
-
21
+
22
22
  def queryForArray( sql, params )
23
23
  sql = self.format_to_sql( sql, params )
24
24
  results = @connection.query(sql)
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.11
4
+ version: 0.0.12
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: 2012-10-26 00:00:00.000000000 Z
12
+ date: 2012-11-06 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A semantic layer for db interaction
15
15
  email: guy@guyirvine.com
@@ -17,6 +17,7 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
+ - lib/FluidDb/Db.rb
20
21
  - lib/FluidDb/Mock.rb
21
22
  - lib/FluidDb/Mysql.rb
22
23
  - lib/FluidDb/Mysql2.rb