Patch #28939 » database.rb.patch
| database.rb (working copy) | ||
|---|---|---|
|
class << self
|
||
|
# Returns true if the database is PostgreSQL
|
||
|
def postgresql?
|
||
|
(ActiveRecord::Base.connection.adapter_name =~ /postgresql/i).present?
|
||
|
ActiveRecord::Base.connection.adapter_name.casecmp('postgresql') == 0
|
||
|
end
|
||
|
# Returns the PostgreSQL version or nil if another DBMS is used
|
||
| ... | ... | |
|
# Returns true if the database is MySQL
|
||
|
def mysql?
|
||
|
(ActiveRecord::Base.connection.adapter_name =~ /mysql/i).present?
|
||
|
ActiveRecord::Base.connection.adapter_name.casecmp('mysql') == 0
|
||
|
end
|
||
|
# Returns a SQL statement for case/accent (if possible) insensitive match
|
||