fluiddb 0.0.25 → 0.0.26
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/FluidDb/Pgsql.rb +8 -1
- metadata +1 -1
data/lib/FluidDb/Pgsql.rb
CHANGED
@@ -95,8 +95,15 @@ module FluidDb
|
|
95
95
|
|
96
96
|
def execute( sql, params, expected_affected_rows=nil )
|
97
97
|
sql = self.format_to_sql( sql, params )
|
98
|
-
r = @connection.query( sql );
|
99
98
|
|
99
|
+
parts = sql.split( "?" )
|
100
|
+
sql = ""
|
101
|
+
parts.each_with_index do |p,idx|
|
102
|
+
sql = sql + p;
|
103
|
+
sql = sql + "$#{idx}" if idx > 0
|
104
|
+
end
|
105
|
+
r = @connection.exec_params( sql, params );
|
106
|
+
|
100
107
|
if !expected_affected_rows.nil? and
|
101
108
|
r.cmd_tuples != expected_affected_rows then
|
102
109
|
raise ExpectedAffectedRowsError.new( "Expected affected rows, #{expected_affected_rows}, Actual affected rows, #{r.cmd_tuples}")
|