Skip to content

select()

Signature

builder.select(columns?: string): this

columns defaults to '*'. Pass a comma-separated string for specific columns.

Examples

// All columns
await massi.from('posts').select('*')
// Specific columns
await massi.from('posts').select('id, title, created_at')
// With filters
await massi
.from('posts')
.select('*')
.eq('published', true)
.order('created_at', { ascending: false })

Response

{
data: Post[] | null,
error: MassiError | null,
count: number | null,
}

See Filters and Modifiers for the full query surface.