// Query 1: Drizzle relational query
// Result type incorrectly omits `| undefined` or `| null` for `customer`.
const res = db.query.company.findFirst({
with: {
customer: {
columns: {
companyId: true,
},
},
},
});
// Inferred type of `res`:
// PgRelationalQuery<{
// name: string;
// id: number;
// website: string | null;
// nameSearch: string | null;
// websiteSearch: string | null;
// createdAt: Date;
// updatedAt: Date;
// customer: {
// companyId: number;
// };
// } | undefined> // <-- `customer` is not allowing null
// Query 1: Drizzle relational query
// Result type incorrectly omits `| undefined` or `| null` for `customer`.
const res = db.query.company.findFirst({
with: {
customer: {
columns: {
companyId: true,
},
},
},
});
// Inferred type of `res`:
// PgRelationalQuery<{
// name: string;
// id: number;
// website: string | null;
// nameSearch: string | null;
// websiteSearch: string | null;
// createdAt: Date;
// updatedAt: Date;
// customer: {
// companyId: number;
// };
// } | undefined> // <-- `customer` is not allowing null