Skip to content

Commit

Permalink
Postgres, fix timestamp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseChavez committed Dec 3, 2024
1 parent c2a43cd commit 6106317
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions lib/arjdbc/postgresql/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def configure_connection
citext: { name: 'citext' },
date: { name: 'date' },
daterange: { name: 'daterange' },
datetime: { name: 'timestamp' },
datetime: {}, # set dynamically based on datetime_type
timestamptz: { name: 'timestamptz' },
decimal: { name: 'decimal' }, # :limit => 1000
float: { name: 'float' },
Expand Down Expand Up @@ -155,14 +155,6 @@ def configure_connection
xml: { name: 'xml' }
}

def native_database_types
NATIVE_DATABASE_TYPES
end

def valid_type?(type)
!native_database_types[type].nil?
end

def set_standard_conforming_strings
execute("SET standard_conforming_strings = on", "SCHEMA")
end
Expand Down Expand Up @@ -878,6 +870,18 @@ def self.database_exists?(config)
public :sql_for_insert
alias :postgresql_version :database_version

def native_database_types # :nodoc:
self.class.native_database_types
end

def self.native_database_types # :nodoc:
@native_database_types ||= begin
types = NATIVE_DATABASE_TYPES.dup
types[:datetime] = types[datetime_type]
types
end
end

private

FEATURE_NOT_SUPPORTED = "0A000" # :nodoc:
Expand Down

0 comments on commit 6106317

Please sign in to comment.