Loading Depth Study
Preparing your workspace
The Supabase client provides application-friendly methods for reading and writing PostgreSQL data.
The Supabase JavaScript client allows applications to query tables without writing every SQL statement manually. Common operations include select, insert, update, upsert, and delete. Filters can be applied to reduce the returned data. Query results should always be checked for errors, and applications should request only the fields they actually need. The client can be used from supported application environments, but credential choice and access control depend on where the code runs.
A course page can use the Supabase client to retrieve a published course by its ID.
const { data, error } = await supabase
.from('courses')
.select('id, title, description')
.eq('published', true)
.order('created_at', { ascending: false });
if (error) {
throw error;
}
console.log(data);The application retrieves published courses with selected fields, sorted by newest creation time.