module ActiveRecord::ConnectionAdapters::PostgreSQL::Utils
def extract_schema_qualified_name(string)
* "schema_name".table_name
* schema_name."table.name"
* schema_name.table_name
* "table.name"
* table_name
+string+ supports the range of schema/table references understood by PostgreSQL, for example:
+schema+ and +identifier+ exclude surrounding quotes (regardless of whether provided in +string+)
+schema+ is +nil+ if not specified in +string+.
extracted from +string+.
Returns an instance of ActiveRecord::ConnectionAdapters::PostgreSQL::Name
def extract_schema_qualified_name(string) schema, table = string.scan(/[^".]+|"[^"]*"/) if table.nil? table = schema schema = nil end PostgreSQL::Name.new(schema, table) end
def unquote_identifier(identifier)
def unquote_identifier(identifier) if identifier && identifier.start_with?('"') identifier[1..-2] else identifier end end