odbc-api
odbc-api copied to clipboard
Does odbc-api how to get column comments(Description)
E.g: how to get config table Description
Table "public.basic_config"
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
-------------+--------------------------+-----------+----------+------------------------------------------+----------+-------------+--------------+---------------------
id | integer | | not null | nextval('basic_config_id_seq'::regclass) | plain | | | The basic_config id
center_name | character varying | | not null | | extended | | |
enable | boolean | | not null | false | plain | | |
create_time | timestamp with time zone | | not null | now() | plain | | |
Indexes:
"basic_config_pkey" PRIMARY KEY, btree (id)
Access method: heap
Several ways to do it. You may want to look at the implementation of the columns
subcommand of odbcsv
. https://github.com/pacman82/odbc-api/blob/18eeb4804d4da934056f0dcc1e6e258e91e7c7ed/odbcsv/src/main.rs#L521
Metadata
connected to cursors can also achieve the same thing. https://docs.rs/odbc-api/0.48.0/odbc_api/trait.ResultSetMetadata.html
Several ways to do it. You may want to look at the implementation of the
columns
subcommand ofodbcsv
.https://github.com/pacman82/odbc-api/blob/18eeb4804d4da934056f0dcc1e6e258e91e7c7ed/odbcsv/src/main.rs#L521
Metadata
connected to cursors can also achieve the same thing. https://docs.rs/odbc-api/0.48.0/odbc_api/trait.ResultSetMetadata.html
Hi @pacman82 : Based on the information you provided, I haven't found a way to get the description.
Actually, I want this value from the table above: The basic_config id
It's not an ODBC feature (at least that I know of). Have you considered just querying that table?
Have you considered just querying that table?
I am currently querying the table column name in this way: https://github.com/baoyachi/odbc-api-helper/blob/main/src/executor/database.rs#L143-L165
What I meant is: Have you tried querying that config table you talk about via SELECT
. The meta information you search does not seem to be part of the ODBC standard.
Not in scope of odbc-api. Closing issue.