fluiddb 0.0.26 → 0.0.27
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/FluidDb/Pgsql.rb +9 -3
- metadata +1 -1
data/lib/FluidDb/Pgsql.rb
CHANGED
@@ -94,15 +94,21 @@ module FluidDb
|
|
94
94
|
|
95
95
|
|
96
96
|
def execute( sql, params, expected_affected_rows=nil )
|
97
|
-
sql = self.format_to_sql( sql, params )
|
98
|
-
|
97
|
+
# sql = self.format_to_sql( sql, params )
|
98
|
+
|
99
99
|
parts = sql.split( "?" )
|
100
100
|
sql = ""
|
101
101
|
parts.each_with_index do |p,idx|
|
102
102
|
sql = sql + p;
|
103
103
|
sql = sql + "$#{idx}" if idx > 0
|
104
104
|
end
|
105
|
-
|
105
|
+
|
106
|
+
p = Array.new
|
107
|
+
params.each do |v|
|
108
|
+
p << Hash["value", v.to_s, "type", v.class.name, "format", 0]
|
109
|
+
end
|
110
|
+
|
111
|
+
r = @connection.exec_params( sql, p );
|
106
112
|
|
107
113
|
if !expected_affected_rows.nil? and
|
108
114
|
r.cmd_tuples != expected_affected_rows then
|