diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-05-18 08:53:33 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-05-18 08:53:36 -0400 |
commit | 7bfd567154b9fd468e5df53901c3d8c383cc25f8 (patch) | |
tree | 9967a2bc8fa8880193285f2dd52d77186bdb072d /lib/sisu/v6/dbi.rb | |
parent | v5 v6: db, use symbols to identify sql engine (diff) |
v5 v6: db, remove ruby-dbi, for: pg ruby-pg, sqlite ruby-sqlite3 (already uses)
* ruby-pg require for postgresql
* ruby-sqlite3 require for sqlite3 (done previously: already using ruby-sqlite3
rather than ruby-dbi)
* ruby-dbi remove calls (in any common files & sisu pg and sisu sqlite3)
* separate pg and sqlite db actions
Diffstat (limited to 'lib/sisu/v6/dbi.rb')
-rw-r--r-- | lib/sisu/v6/dbi.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sisu/v6/dbi.rb b/lib/sisu/v6/dbi.rb index 5bd98b8a..7432f2f3 100644 --- a/lib/sisu/v6/dbi.rb +++ b/lib/sisu/v6/dbi.rb @@ -71,7 +71,6 @@ module SiSU_DBI include SiSU_FormatShared class SQL def initialize(opt) - SiSU_Env::Load.new('dbi',true).prog @opt=opt @db=SiSU_Env::InfoDb.new if @opt.cmd =~/[Dd]/ \ @@ -96,6 +95,9 @@ module SiSU_DBI maintenance_check(@opt,__FILE__,__LINE__) if @opt.act[:maintenance][:set]==:on :sqlite end + if @sql_type==:pg then SiSU_Env::Load.new('pg',true).prog + elsif @sql_type==:sqlite then SiSU_Env::Load.new('sqlite3',true).prog + end end end def maintenance_check(opt,file,line) @@ -105,7 +107,8 @@ module SiSU_DBI end def read_psql begin - @conn=@db.psql.conn_dbi + require 'pg' + @conn=@db.psql.conn_pg rescue if @opt.mod.inspect=~/--(?:createall|create)/ cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX |