Stephen Haberman
Stephen Haberman
Do we also need queries tagged can "can currently load an entity"? E.g. ```typescript const a = new AuthorAlias("a"); const b = new BookAlias("b"); const br = new BookReviewAlias("br"); const...
Is our use case only finding & loading entities, or do we want to support aggregates & adhoc data structures? https://github.com/stephenh/joist-java/blob/master/features/src/test/java/features/domain/queries/PrimitivesGroupByTest.java ``` Select q = Select.from(p); q.select(p.flag.as("flag"), q.count.as("count")); q.groupBy(p.flag); q.orderBy(p.flag.asc());...
Also think about strongly typed id fields, so that `.join(books b, b.id, br.author_id` typos cannot happen
Might be nice to use destructuring to assign the aliases: ``` const { Child: c, Parent: p } = aliases; const q = em.selectFrom(c).join(p, c).where(p.name.eq("a")); return q.run(); ```
Examples from Kysely: ``` const person = await db .selectFrom('person') .selectAll() .where('id', '=', 100) .executeTakeFirst() // maybe const { Person: p } = tables; em.selectFrom(p).where(p.id.eq(100)); ``` ``` const persons =...
Pros/cons of using Kysely: * Pro: it's awesome * Con: `where('author.first_name', '=', 'asdf')` seems more verbose than `where(author.first_name.eq("asdf"))` * Con: we would want to support auto-detagging and accepting entities, i.e....
Yep, good idea. Will add it to the list.
@mmahalwy yeah, we might end up doing this. Fwiw I assert once you get used to it, it really doesn't matter / is not that different in practice from being...
@mmahalwy hm, how would type checking working? I.e. the `validation` field needs to have a certain shape. I know JS ORMs use this approach, but they don't have to worry...
@mmahalwy no, that is this example: ``` type Rule = (fn: string) => boolean; class Base { static validation: Rule[] = []; } class Child extends Base { static validation...