SweetIQ/schemats

Generates invalid ts file if a table has column named "default"

msuntharesan opened this issue · 3 comments

Hello,
I noticed this on postgres.
Ex:

image

I think it should rename it to _default

Indeed, we should have a list of words allowed in SQL, but reserved in Typescript in order to rename them at generation.

You could have used var as a column name too 😉

xiamx commented

You can modify https://github.com/SweetIQ/schemats/blob/master/src/typescript.ts#L11 and add "default" into the reserved words and make a pull request.

You can modify /src/typescript.ts@master#L11 and add "default" into the reserved words and make a pull request.

Oh nice, didn't know.