Closed tobe-continued closed 2 weeks ago
Hello, i'm working on MySQL 5.7 in my office, and when i want use nested array, it doesn't work.
This :
import { jsonArrayFrom } from 'kysely/helpers/postgres' const result = await db .selectFrom('person') .select((eb) => [ 'id', jsonArrayFrom( eb.selectFrom('pet') .select(['pet.id as pet_id', 'pet.name']) .whereRef('pet.owner_id', '=', 'person.id') .orderBy('pet.name') ).as('pets') ]) .execute()
return :
sqlMessage: "Unknown column 'person.id' in 'where clause'",
Anyone has solution for this ?
See you later !
You're importing the jsonArrayFrom helper from Postgres.
jsonArrayFrom
Hello, i'm working on MySQL 5.7 in my office, and when i want use nested array, it doesn't work.
This :
return :
Anyone has solution for this ?
See you later !