Skip to content

Instantly share code, notes, and snippets.

@max10rogerio
Created January 21, 2021 14:06
Show Gist options
  • Save max10rogerio/f064cc2117619bd0d064ed530a817a8d to your computer and use it in GitHub Desktop.
Save max10rogerio/f064cc2117619bd0d064ed530a817a8d to your computer and use it in GitHub Desktop.
Simple map column to annotations typeorm
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