© 2026 Hedgehog Software, LLC
export const getObservationsByUserId = async ( db: LibSQLDatabase, uid: string, search?: string, page?: Pagination ): Promise<Observation[]> => { const { limit, offset } = page || { limit: 10, offset: 0 } const observationsForUserId = db.select().from(observations).where(eq(observations.owner, uid)) if (search) { observationsForUserId.where(ilike(observations.name, `%${search}%`)) } return await observationsForUserId.limit(limit).offset(offset).all() }
SQLITE_ERROR: near "ilike": syntax error
%{search}%