Changeset 686
- Timestamp:
- 09/24/07 11:56:15 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/merb_sequel/lib/merb/orms/sequel/connection.rb
r613 r686 37 37 # Use Sequel::Model.db to access this object 38 38 ::Sequel.mysql(config[:database], :host => host, :user => user, :password => password, :logger => MERB_LOGGER) 39 when 'postgresql' 40 require "sequel/postgres" 41 host = config[:host] || 'localhost' 42 user = config[:user] || config[:username] || 'root' 43 password = config[:password] 44 encoding = config[:encoding] || config[:charset] || nil 45 46 if encoding 47 ::Sequel.postgres(config[:database], :host => host, :user => user, :password => password, :encoding => encoding, :logger => MERB_LOGGER) 48 else 49 ::Sequel.postgres(config[:database], :host => host, :user => user, :password => password, :logger => MERB_LOGGER) 50 end 39 51 when 'sqlite' 40 52 require "sequel/sqlite" 41 53 if config[:database] 42 ::Sequel.sqlite config[:database]54 ::Sequel.sqlite(config[:database], :logger => MERB_LOGGER) 43 55 else 44 ::Sequel.sqlite 56 ::Sequel.sqlite(:logger => MERB_LOGGER) 45 57 end 46 58 else
