Re:Show HN: ORM for TypeScript with no query-builder, suppor...
by exevp on Friday September 04, 2020 @04:17AM
(#24372857)
> I am not sure about what do you mean here?
Given i have defined the columns of interest in my data objects anyways...
class User { name = null; email = null; }
... i wouldn't necessarily have to repeat them when writing my SQL: sql`SELECT ${Object.getOwnPropertyNames(new User).map(camelCase).join(', ')} FROM users`
Of course using a better helper function.There's a few repetitive tasks when writing SQL where don't necessarily need a powerful query builder but still end up writing a few handler functions. Shipping some common helpers with the framework might be handy.
Re:Show HN: ORM for TypeScript with no query-builder, suppor...
by Seb-C on Wednesday September 16, 2020 @12:14AM
(#24489468)
I see what you mean. Indeed, more helpers would be ... helpful I guess, but for now I only implement what I really need and feel like is necessary.
For your specific example, what is wrong with `SELECT *`?
I am not sure about what do you mean here?
> dealing with casing (snake_case to camelCase)
This is one of the opinionated parts of kiss-orm I guess, because I specifically do not want to implement this.
I think having consistency in the naming of the properties/columns is more important. I would rather break the naming convention by having snake_case properties than automagically rename properties.