Sha256: 769d1aacd08a308d46c481ab9d3573cb1607e1323e96e159d787c87e593e1911
Contents?: true
Size: 562 Bytes
Versions: 10
Compression:
Stored size: 562 Bytes
Contents
# frozen_string_literal: true module TableSaw module Queries class TableColumns QUERY = <<~SQL select attname as colname from pg_catalog.pg_attribute where attrelid = $1::regclass and attnum > 0 and attisdropped = false order by attnum SQL attr_reader :table def initialize(table) @table = table end def call TableSaw::Connection.with { |conn| conn.exec_params(QUERY, [table]) }.map { |r| r['colname'] } end end end end
Version data entries
10 entries across 10 versions & 1 rubygems