Lucidchart offers preset SQL statements for importing schema data into from various sql databases but does not offer a solution for Google BigQuery datasets.
Can someone help me figure out a solution for this?
Lucidchart offers preset SQL statements for importing schema data into from various sql databases but does not offer a solution for Google BigQuery datasets.
Can someone help me figure out a solution for this?
Best answer by mattjkenney
Thank you
I was able to use the MySQL version after adding the database name to the table names and removing some columns that were not available in BigQuery tables:
SELECT 'mysql' dbms,t.TABLE_SCHEMA,t.TABLE_NAME,c.COLUMN_NAME,c.ORDINAL_POSITION,c.DATA_TYPE,n.CONSTRAINT_TYPE FROM ['insert full database path'].INFORMATION_SCHEMA.TABLES t LEFT JOIN ['insert full database path'].INFORMATION_SCHEMA.COLUMNS c ON t.TABLE_SCHEMA=c.TABLE_SCHEMA AND t.TABLE_NAME=c.TABLE_NAME LEFT JOIN ['insert full database path'].INFORMATION_SCHEMA.KEY_COLUMN_USAGE k ON c.TABLE_SCHEMA=k.TABLE_SCHEMA AND c.TABLE_NAME=k.TABLE_NAME AND c.COLUMN_NAME=k.COLUMN_NAME LEFT JOIN ['insert full database path'].INFORMATION_SCHEMA.TABLE_CONSTRAINTS n ON k.CONSTRAINT_SCHEMA=n.CONSTRAINT_SCHEMA AND k.CONSTRAINT_NAME=n.CONSTRAINT_NAME AND k.TABLE_SCHEMA=n.TABLE_SCHEMA AND k.TABLE_NAME=n.TABLE_NAME WHERE t.TABLE_TYPE='BASE TABLE' AND t.TABLE_SCHEMA NOT IN('INFORMATION_SCHEMA','mysql','performance_schema');
BigQuery is actually quite intuitive. The noted errors helped guide me through all the needed corrections.
A Lucid account is required to interact with the Community, and your participation is subject to the Supplemental Lucid Community Terms. You may not participate in the Community if you are under age 18. You will be redirected to the Lucid app to create an account.
A Lucid account is required to interact with the Community, and your participation is subject to the Supplemental Lucid Community Terms. You may not participate in the Community if you are under age 18. You will be redirected to the Lucid app to log in.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.