// Relations are declared OUTSIDE the table descriptor, in a `*.relations.ts` // file (convention). The framework registers them at boot; the query // builder's `.with({ books: true })` chain uses them to eager-load. // // An author has MANY books. The `foreignKey` auto-derives because exactly // one `reference()` column on `books` (`authorId`) points back at `authors` // — no explicit override needed. import { relations } from '@voltro/database' import { authors } from './authors.entity' import { books } from './books.entity' export const authorsRelations = relations(authors, ({ many }) => ({ books: many(books), }))