Manage SQL views
Last updated
Was this helpful?
Last updated
Was this helpful?
Please be sure of your agent type and version and pick the right documentation accordingly.
This is the documentation of the forest-express-sequelize
and forest-express-mongoose
Node.js agents that will soon reach end-of-support.
forest-express-sequelize
v9 and forest-express-mongoose
v9 are replaced by v1.
Please check your agent type and version and read on or switch to the right documentation.
In SQL, a view is a virtual table based on the result-set of an SQL statement. Views can provide advantages over tables, such as:
represent a subset of the data contained in a table (see also).
join and simplify many tables into a single virtual table.
act as aggregated tables, where the database engine aggregates data (sum, average etc.) and presents the calculated results as part of the data.
To create a view, we use CREATE VIEW
statement.
In the following example, we look for the user's email, the number of orders and the total amount spent.
To display the SQL view on your Forest Admin interface, you must add the associated Sequelize model in your application.
Once your SQL view is implemented, you'll be able to filter, search, export and change the order of your fields.
Most of the time SQL views are used as read-only. If this is the case, we recommend changing the CRUD permission in your .