Raw sql nullable types, sql<Type | undefined>
This gets inferred to
SQL<any>Is there a way to have a nullable type when using raw sql?
Type?.mapWith()destination: sql<Point | null>`CASE WHEN driver_shifts.ride_id IS NOT NULL THEN active_rides.destination END`.mapWith(driverShifts.location),(property) destination: SQL<Point>mapWithmapWith(property) destination: SQL<Point | null>export const driverShifts = pgTable('driver_shifts', {
id: uuid('id').primaryKey().defaultRandom(),
createdAt: timestamp('created_at').defaultNow().notNull(),
location: pointDB("location").notNull(),
});pointDB.mapWithfunction mapper(value: any): Point | null {
return driverShifts.location.mapFromDriverValue(value);
}
.mapWith(mapper)