Module: Sequel::Postgres::Comment::DatasetMethods
- Defined in:
- lib/sequel/extensions/pg_comment/dataset_methods.rb
Overview
Support for retrieving column comments from a PostgreSQL database via a dataset. For example:
DB[:foo_tbl].comment_for(:some_column)
Will retrieve the comment for foo_tbl.some_column
, if such a
column exists.
Instance Method Summary collapse
-
#comment ⇒ String, NilClass
Retrieve the comment for the "primary" table in the dataset.
-
#comment_for(col) ⇒ String, NilClass
Retrieve the comment for the column named
col
in the "primary" table for this dataset.
Instance Method Details
#comment ⇒ String, NilClass
Retrieve the comment for the "primary" table in the dataset.
34 35 36 |
# File 'lib/sequel/extensions/pg_comment/dataset_methods.rb', line 34 def comment db.comment_for(first_source_table) end |
#comment_for(col) ⇒ String, NilClass
Retrieve the comment for the column named col
in the "primary" table
for this dataset.
19 20 21 |
# File 'lib/sequel/extensions/pg_comment/dataset_methods.rb', line 19 def comment_for(col) db.comment_for("#{first_source_table}__#{col}") end |