Sha256: f77dd54f61302fcea0ae8433bba19b9ff7c2811ac33b1dec65573037e188d5d0

Contents?: true

Size: 548 Bytes

Versions: 24

Compression:

Stored size: 548 Bytes

Contents

module Torque
  module PostgreSQL
    module Adapter
      module Quoting

        Name = ActiveRecord::ConnectionAdapters::PostgreSQL::Name

        # Quotes type names for use in SQL queries.
        def quote_type_name(string, schema = nil)
          name_schema, table = string.to_s.scan(/[^".\s]+|"[^"]*"/)
          if table.nil?
            table = name_schema
            name_schema = nil
          end

          schema = schema || name_schema || 'public'
          Name.new(schema, table).quoted
        end

      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
torque-postgresql-0.2.16 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.15 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.14 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.13 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.12 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.11 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.10 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.9 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.8 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.7 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.6 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.5 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.4 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.3 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.2 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.2.1 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.1.7 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.1.6 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.1.5 lib/torque/postgresql/adapter/quoting.rb
torque-postgresql-0.1.4 lib/torque/postgresql/adapter/quoting.rb