From ebf94e9197bc7cc923f7f1b721fee8768853d0c8 Mon Sep 17 00:00:00 2001 From: Reece Daniels Date: Thu, 17 Mar 2022 23:22:24 +0000 Subject: [PATCH] wrap column names in quotes for numeric & hyphen based column names --- src/typescript.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/typescript.ts b/src/typescript.ts index 79ad756..6d0059e 100644 --- a/src/typescript.ts +++ b/src/typescript.ts @@ -85,8 +85,8 @@ export function generateTableInterface( } } - selectableMembers += `${jsdoc}${columnName}: ${tsType}${possiblyOrNull};\n`; - insertableMembers += `${jsdoc}${columnName}${insertablyOptional}: ${tsType}${possiblyOrNull};\n`; + selectableMembers += `${jsdoc}'${columnName}': ${tsType}${possiblyOrNull};\n`; + insertableMembers += `${jsdoc}'${columnName}'${insertablyOptional}: ${tsType}${possiblyOrNull};\n`; columns.push(columnName); if (!columnDef.nullable && !columnDef.hasDefault) {