SELECT * FROM {table} against the PostgreSQL database and returns every row found. It is the primary way to populate dropdown lists, data grids, and reference tables on the frontend — for example, fetching all payment methods, municipalities, or customers in a single call.
Endpoint
Path Parameters
string
required
Name of the PostgreSQL table to query. The value is interpolated directly into the SQL statement as
SELECT * FROM {table}. Common values used in the reference implementation:Responses
200 — OK
Returned when at least one row is found (rowCount > 0).
number
Always
200 on success.string
Human-readable confirmation:
"Datos encontrados".array
Array of row objects returned by PostgreSQL. Each object’s keys correspond to the column names of the queried table.
404 — Not Found
Returned whenrowCount === 0 (the table exists but contains no rows).
number
404 when no rows are found.string
"No se encontraron datos"500 — Internal Server Error
Returned when the query throws (e.g., the table does not exist, a connection error, etc.).number
500 on an unhandled exception.string
"Error al obtener los datos"object
The raw error object thrown by the
pg driver. Contains fields such as code, detail, and message from PostgreSQL.