Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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