SweetIQ/schemats

Camelized column names

vitaly-t opened this issue ยท 2 comments

In case you want automatically camelized column names, see event receive, and the example that follows ๐Ÿ˜‰ Could make for a nicer TypeScript style ๐Ÿ˜‰

Caramelized, LOL ๐Ÿ˜ธ

+1 for the feature : as a fresh user of this module, I was precisely thinking about this.
But I wonder : why use pgp event receive, and not camelize while generating ts code in https://github.com/SweetIQ/schemats/blob/master/src/typescript.ts#L16 ?

Ah sorry, I was thinking of camelizing pascalizing table/interface name, definitely not the same topic... ๐Ÿ˜‘

xiamx commented

Yup, this is definitely needed. We guys at SweetIQ didn't experience this camel_snakeCase eye candy because our database was migrated from a mongodb database where keys(columns) are all camelCased ๐Ÿ˜‚ . But we instead had to double quote all column names in our SQL queries.