Last active
January 28, 2019 09:09
-
-
Save luobotang/928a2700b76fd99f40ab7a706dadd455 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateSql(db) { | |
return ` | |
SELECT | |
t.table_name, | |
c.column_name, | |
c.data_type | |
FROM | |
INFORMATION_SCHEMA.TABLES t JOIN | |
INFORMATION_SCHEMA.COLUMNS c ON | |
t.table_schema = c.table_schema AND | |
t.table_name = c.table_name | |
WHERE | |
t.table_schema = '${db}' | |
ORDER BY | |
t.table_schema, | |
t.table_name, | |
c.ordinal_position` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment