Skip to content

SELECT & Filters

const users = await pb.from(User).find();
const user = await pb.from(User)
.where('email', 'jane@example.com')
.findOne();
const count = await pb.from(User).where('status', 'active').count();
// Returns: number

Pulsabase uses cursor-style pagination via limit and offset:

// Page 1: records 1–20
const page1 = await pb.from(User)
.orderBy('created_at', 'desc')
.limit(20)
.offset(0)
.find();
// Page 2: records 21–40
const page2 = await pb.from(User)
.orderBy('created_at', 'desc')
.limit(20)
.offset(20)
.find();
const names = await pb.from(User).select('id', 'name', 'email').find();
// Single sort
const users = await pb.from(User).orderBy('created_at', 'desc').find();
// Multi-column sort
const users = await pb.from(User)
.orderBy('last_name', 'asc')
.orderBy('first_name', 'asc')
.find();
const cities = await pb.from(User).select('city').distinct().find();
// DISTINCT ON a specific column
const uniqueByCity = await pb.from(User).distinctOn('city').find();