A request to a database to retrieve, insert, update, or delete data.
A query is a command sent to a Database asking it to do something with data. Queries retrieve specific data (SELECT), insert new rows (INSERT), modify existing rows (UPDATE), or delete rows (DELETE). Queries use SQL (Structured Query Language), a standard language all databases understand.
Queries are the only way to interact with databases. A query describes exactly what data you want and how to filter it. Good queries are efficient and return only needed data. Your Backend receives requests from clients, translates them to queries, executes them, and returns results. RLS filters query results based on user permissions. Schemas define the structure queries operate on.
In React Router apps, loaders run queries to fetch data (SELECT) and actions run queries to save data (INSERT/UPDATE/DELETE). You write queries using Supabase's client Library, an ORM, or raw SQL. Queries are asynchronous operations that return Promises. When a query fails, check the Status Code in the Network Tab and use Logging to trace what was sent. If a query returns empty data with no error, suspect RLS. Error Handling with Try/Catch prevents query failures from crashing your app.
Query performance can be dramatically improved with database indexes, which create lookup structures on frequently queried columns.
We give you the skills to build, deploy, and own a full product. Professional stack, AI co-pilot, no coding background required.