SQLite 'WHERE table.relationship (one to many) > 0'

Hi! I'm trying to figure out how to query for rows that have a relationship at least defined once.
  const allVideos = await db.query.videos.findMany({
    where: // Not all videos have timestamps (one-to-many). Exclude those somehow
    with: {
      timestamps: true
    },
  });

  // Below should not be done in memory.
  return allVideos.filter(
    (video) => video.timestamps.length > 0
  );

Can't seem to find any examples of this in the docs. Any help would be greatly appreciated, thanks.
Was this page helpful?