aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/db_create.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-05-18 08:49:03 -0400
committerRalph Amissah <ralph@amissah.com>2014-05-18 08:49:03 -0400
commit307ecb4df591aa675b71839014debf6e81d462e1 (patch)
tree647e6738bc5868f09c62e07cc03c45ab64e3c1cd /lib/sisu/v6/db_create.rb
parentv6: utils, add ok code marker (diff)
v5 v6: db, use symbols to identify sql engine
Diffstat (limited to 'lib/sisu/v6/db_create.rb')
-rw-r--r--lib/sisu/v6/db_create.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/sisu/v6/db_create.rb b/lib/sisu/v6/db_create.rb
index 661059a1..105f089c 100644
--- a/lib/sisu/v6/db_create.rb
+++ b/lib/sisu/v6/db_create.rb
@@ -66,10 +66,10 @@ module SiSU_DbCreate
class Create < SiSU_DbColumns::Columns
require_relative 'sysenv' # sysenv.rb
@@dl=nil
- def initialize(opt,conn,file,sql_type='pg')
+ def initialize(opt,conn,file,sql_type=:pg)
@opt,@conn,@file,@sql_type=opt,conn,file,sql_type
@cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX
- @comment=(@sql_type=='pg') \
+ @comment=(@sql_type==:pg) \
? (SiSU_DbCreate::Comment.new(@conn,@sql_type))
: nil
@@dl ||=SiSU_Env::InfoEnv.new.digest.length
@@ -84,7 +84,7 @@ module SiSU_DbCreate
end
def create_db
@env=SiSU_Env::InfoEnv.new(@opt.fns)
- tell=(@sql_type=='sqlite') \
+ tell=(@sql_type==:sqlite) \
? SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Create SQLite db tables in:',%{"#{@file}"})
: SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Create pgSQL db tables in:',%{"#{Db[:name_prefix]}#{@env.path.stub_pwd}"})
if (@opt.act[:verbose][:set]==:on \
@@ -92,7 +92,7 @@ module SiSU_DbCreate
|| @opt.act[:maintenance][:set]==:on)
tell.dark_grey_title_hi
end
- SiSU_Env::SystemCall.new.create_pg_db(@env.path.stub_pwd) if @sql_type=='pg' #watch use of path.stub_pwd instead of stub
+ SiSU_Env::SystemCall.new.create_pg_db(@env.path.stub_pwd) if @sql_type==:pg #watch use of path.stub_pwd instead of stub
end
def output_dir?
dir=SiSU_Env::InfoEnv.new('')
@@ -105,7 +105,7 @@ module SiSU_DbCreate
if (@opt.act[:verbose_plus][:set]==:on \
or @opt.act[:maintenance][:set]==:on)
print %{
- currently using sisu dbi module
+ currently using sisu_dbi module
to be populated from document files
create tables metadata_and_text
data import through ruby transfer
@@ -343,7 +343,7 @@ module SiSU_DbCreate
if (@opt.act[:verbose_plus][:set]==:on \
or @opt.act[:maintenance][:set]==:on)
print %{
- currently using sisu dbi module
+ currently using sisu_dbi module
to be populated from doc_objects files
create tables urls
data import through ruby transfer
@@ -377,9 +377,9 @@ module SiSU_DbCreate
end
end
class Comment < SiSU_DbColumns::Columns
- def initialize(conn,sql_type='pg')
+ def initialize(conn,sql_type=:pg)
@conn=conn
- if sql_type =~ /pg/; psql
+ if sql_type == :pg then psql
end
end
def psql