durcno@1.0.0-alpha.8
Major Changes
-
3c59b24 - Thanks to @almahdi404 !
change!: rename DurcnoLogger to QueryLogger
The exported
DurcnoLoggerinterface has been renamed toQueryLoggerfor clarity and consistency.This is a breaking change. Any code that imports or references
DurcnoLoggermust be updated to useQueryLoggerinstead.// Beforeimport type { DurcnoLogger } from "durcno";const logger: DurcnoLogger = { info: (msg, meta) => console.log(msg, meta) };// Afterimport type { QueryLogger } from "durcno";const logger: QueryLogger = { info: (msg, meta) => console.log(msg, meta) };The rename affects the exported type from
durcno, theloggeroption inConnectorOptions, and the return type ofcreateQueryLogger().
Minor Changes
-
099e86a - Thanks to @almahdi404 !
feat(rq): support where, orderBy, and limit on nested many relations
Nested
many(one-to-many) relations insidewithnow acceptwhere,orderBy, andlimitoptions. These are applied as additional SQL clauses within the relation subquery, making it possible to filter, sort, and cap related rows directly in the relational query.const posts = await db.query(Posts).findMany({with: {comments: {where: eq(Comments.isEdited, true),orderBy: desc(Comments.createdAt),limit: 5,},},});At the type level,
where,orderBy, andlimitare disallowed on nestedfk(many-to-one) andone(one-to-one) relations — the TypeScript compiler will reject such usage with a clear error. The join condition for those relation types already uniquely identifies the related row, so further filtering is not meaningful.