Get table and view names + types
gz opened this issue · comments
Gerd Zellweger commented
Given a SQL query
CREATE TABLE demographics (
cc_num FLOAT64 NOT NULL,
);
CREATE TABLE transactions (
trans_date_trans_time TIMESTAMP,
);
CREATE VIEW transactions_with_demographics as
SELECT
transactions.cc_num,
FROM
...
I'd like to get the following info in JSON: table names & type, view names, view type. e.g., something like that (actual schema is open to discussion):
{
tables: [ {name: 'demographics', fields: [ { name: 'cc_num', type: 'float64', attributes: ['not null', 'unique'] }, ... ], ... }
views: [ {name: 'transactions_with_demographics', fields: [{name: 'cc_num', type: float64, attributes: []}, ...]}, ...]
}