Module: ActiveRecord::ConnectionAdapters::Redshift::Utils
- Extended by:
- Utils
- Included in:
- Utils
- Defined in:
- lib/active_record/connection_adapters/redshift/utils.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#extract_schema_qualified_name(string) ⇒ Object
Returns an instance of
ActiveRecord::ConnectionAdapters::PostgreSQL::Nameextracted fromstring.
Instance Method Details
#extract_schema_qualified_name(string) ⇒ Object
Returns an instance of ActiveRecord::ConnectionAdapters::PostgreSQL::Name extracted from string. schema is nil if not specified in string. schema and identifier exclude surrounding quotes (regardless of whether provided in string) string supports the range of schema/table references understood by PostgreSQL, for example:
-
table_name -
"table.name" -
schema_name.table_name -
schema_name."table.name" -
"schema_name".table_name -
"schema.name"."table name"
59 60 61 62 |
# File 'lib/active_record/connection_adapters/redshift/utils.rb', line 59 def extract_schema_qualified_name(string) table, schema = string.scan(/[^".\s]+|"[^"]*"/)[0..1].reverse Redshift::Name.new(schema, table) end |