Open masons40 opened 2 months ago
Same issue here. If you don't need the geometry column in your context, you can explicitly omit it. For the example above, it would look something like:
const reviews = await db.query.reviews.findMany({
with: { hotel: { columns: { id: true, name: true } } },
});
Thanks @masons40 for providing the workaround using db.select()
.
What version of
drizzle-orm
are you using?0.32.1
What version of
drizzle-kit
are you using?0.23.0
Describe the Bug
Using the 'with' statement in the findFirst and findMany queries results in this error "RangeError: Offset is outside the bounds of the DataView" if the related table has a geometry column.
Steps to reproduce: Two tables with the following relationship
running the following queries should result in the error stated above.
It appears that the generated SQL for both the findFirst and findMany queries works fine
It works works fine if I use the standard select method with a leftJoin on the hotels table.
It appears it could be a parsing issue with the findFirst and findMany queries if using the 'with' statement on a table with a geometry column.
Expected behavior
Both the findFirst and findMany queries should return the review object and related hotel object correctly.
Environment & setup
Next.js project using a Supabase postgres DB with the PostGIS extension enabled.