Fetch data: select()
Performs horizontal filtering with SELECT.
- JavaScript
- Python
Parameters
columnsrequiredstring
The columns to retrieve, separated by commas.
Notes
Examples
Getting your data
- JavaScript
- Python
Selecting specific columns
You can select specific fields from your tables.
- JavaScript
- Python
Query foreign tables
If your database has relationships, you can query related tables too.
- JavaScript
- Python
Query the same foreign table multiple times
Sometimes you will need to query the same foreign table twice. In this case, you can use the name of the joined column to identify which join you intend to use. For convenience, you can also give an alias for each column. For example, if we had a shop of products, and we wanted to get the supplier and the purchaser at the same time (both in the users) table:
- JavaScript
- Python
Quering JSON data
If you have data inside of a JSONB column, you can apply select and query filters to the data values. Postgres offers a number of operators for querying JSON data. Also see PostgREST docs for more details.
- JavaScript
- Python