Class: SnowflakeOdbcAdapter::Metadata

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/snowflake_odbc_adapter/metadata.rb

Overview

:nodoc:

Constant Summary collapse

FIELDS =
%i[
  SQL_DBMS_NAME
  SQL_DBMS_VER
  SQL_IDENTIFIER_CASE
  SQL_QUOTED_IDENTIFIER_CASE
  SQL_IDENTIFIER_QUOTE_CHAR
  SQL_MAX_IDENTIFIER_LEN
  SQL_MAX_TABLE_NAME_LEN
  SQL_USER_NAME
  SQL_DATABASE_NAME
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMetadata

Returns a new instance of Metadata.



23
24
25
# File 'lib/snowflake_odbc_adapter/metadata.rb', line 23

def initialize
  @mutex = Mutex.new
end

Instance Attribute Details

#identifier_quote_charObject (readonly)

Returns the value of attribute identifier_quote_char.



21
22
23
# File 'lib/snowflake_odbc_adapter/metadata.rb', line 21

def identifier_quote_char
  @identifier_quote_char
end

Instance Method Details

#connection(config, connection) ⇒ Object



37
38
39
40
41
42
43
44
# File 'lib/snowflake_odbc_adapter/metadata.rb', line 37

def connection(config, connection)
  unless @connection
    with_mutex do
      @connection = connection
    end
  end
  @connection
end

#upcase_identifiers?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/snowflake_odbc_adapter/metadata.rb', line 33

def upcase_identifiers?
  (identifier_case == ODBC::SQL_IC_UPPER)
end