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.rb20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/sisu/v6/db_indexes.rb b/lib/sisu/v6/db_indexes.rb
index f293012f..7df20889 100644
--- a/lib/sisu/v6/db_indexes.rb
+++ b/lib/sisu/v6/db_indexes.rb
@@ -62,15 +62,29 @@
=end
module SiSU_DbIndex
- class Index # create documents Indexes def initialize(opt,conn='',sql_type='')
- def initialize(opt,conn,file,sql_type='')
+ class Index # create documents Indexes def initialize(opt,conn='',sql_type)
+ def initialize(opt,conn,file,sql_type)
@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