schemats icon indicating copy to clipboard operation
schemats copied to clipboard

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

Open msuntharesan opened this issue 6 years ago • 3 comments

Hello, I noticed this on postgres. Ex:

image

I think it should rename it to _default

msuntharesan avatar Apr 19 '18 13:04 msuntharesan

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 😉

abenhamdine avatar Apr 19 '18 13:04 abenhamdine

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.

xiamx avatar Apr 20 '18 04:04 xiamx

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.

abenhamdine avatar Apr 20 '18 07:04 abenhamdine