aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/db_indexes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v6/db_indexes.rb')
-rw-r--r--lib/sisu/v6/db_indexes.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/sisu/v6/db_indexes.rb b/lib/sisu/v6/db_indexes.rb
index 6550fe51..7df20889 100644
--- a/lib/sisu/v6/db_indexes.rb
+++ b/lib/sisu/v6/db_indexes.rb
@@ -67,10 +67,24 @@ module SiSU_DbIndex
@opt,@conn,@file,@sql_type=opt,conn,file,sql_type
end
def create_indexes # check added from pg not tested
+ def conn_execute_sql_pg(conn,sql)
+ conn.exec_params(sql)
+ end
+ def conn_execute_sql_sqlite(conn,sql)
+ conn.execute(sql)
+ end
+ def conn_execute_sql(conn,sql)
+ if @sql_type==:pg
+ conn_execute_sql_pg(conn,sql)
+ elsif @sql_type==:sqlite
+ conn_execute_sql_sqlite(conn,sql)
+ else
+ end
+ end
def conn_execute_array(sql_arr)
@conn.transaction do |conn|
sql_arr.each do |sql|
- conn.execute(sql)
+ conn_execute_sql(conn,sql)
end
end
end