Created
January 21, 2021 14:06
-
-
Save max10rogerio/f064cc2117619bd0d064ed530a817a8d to your computer and use it in GitHub Desktop.
Simple map column to annotations typeorm
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
SELECT | |
E'@Column({ name: \'' || column_name || E'\', type: \'' || data_type || E'\'})' | |
FROM | |
INFORMATION_SCHEMA.COLUMNS | |
WHERE | |
TABLE_NAME = 'yourtable' | |
AND TABLE_SCHEMA = 'your schema if necessary'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment