SELECT & Filters
Find All Records
Section titled “Find All Records”const users = await pb.from(User).find();final users = await pb.from('users').find();{ "action": "find", "table": "users"}Find One Record
Section titled “Find One Record”const user = await pb.from(User) .where('email', 'jane@example.com') .findOne();final user = await pb.from('users') .where('email', 'jane@example.com') .findOne();{ "action": "findOne", "table": "users", "query": { "email": "jane@example.com" }}Count Records
Section titled “Count Records”const count = await pb.from(User).where('status', 'active').count();// Returns: numberfinal count = await pb.from('users').where('status', 'active').count();Pagination
Section titled “Pagination”Pulsabase uses cursor-style pagination via limit and offset:
// Page 1: records 1–20const page1 = await pb.from(User) .orderBy('created_at', 'desc') .limit(20) .offset(0) .find();
// Page 2: records 21–40const page2 = await pb.from(User) .orderBy('created_at', 'desc') .limit(20) .offset(20) .find();final page1 = await pb.from('users') .orderBy('created_at', ascending: false) .limit(20) .offset(0) .find();{ "action": "find", "table": "users", "sort": [{ "field": "created_at", "order": "desc" }], "limit": 20, "offset": 0}Select Specific Columns
Section titled “Select Specific Columns”const names = await pb.from(User).select('id', 'name', 'email').find();final names = await pb.from('users').select(['id', 'name', 'email']).find();{ "action": "find", "table": "users", "select": ["id", "name", "email"]}Sort Records
Section titled “Sort Records”// Single sortconst users = await pb.from(User).orderBy('created_at', 'desc').find();
// Multi-column sortconst users = await pb.from(User) .orderBy('last_name', 'asc') .orderBy('first_name', 'asc') .find();final users = await pb.from('users') .orderBy('created_at', ascending: false) .find();{ "action": "find", "table": "users", "sort": [ { "field": "last_name", "order": "asc" }, { "field": "first_name", "order": "asc" } ]}Distinct
Section titled “Distinct”const cities = await pb.from(User).select('city').distinct().find();
// DISTINCT ON a specific columnconst uniqueByCity = await pb.from(User).distinctOn('city').find();final cities = await pb.from('users').select(['city']).distinct().find();