Introduction
The Queries feature in VIPS lets you create custom SQL reports that combine data from multiple tables. Reports can be interactive with filters, reusable across projects, and even accessed through automatically generated API links.
Import Query File
Import allows you to restore queries previously saved in VIPS.
- Only
.bato
files are supported. .bato
files are generated by VIPS itself when exporting a query.- Standard
.sql
files are not compatible.
Add Report Query
When creating a new query, VIPS asks for:
- Report Name – Display name of the report.
- Key Name – Same as report name, used internally.
- Report Info – Description of the report.
- Full Query – The SQL statement.
Note: If the query has errors, it will not be saved.
Custom Parameters
Parameters make queries dynamic. They are defined with a :
prefix.
SELECT * FROM student WHERE birthdate = :birthdate;
VIPS generates input fields depending on parameter suffix:
Suffix | Input Type |
---|---|
_date | Date picker |
_month | Month selector |
_year | Year selector |
_datetime | Date & Time picker |
_time | Time selector |
_week | Week selector |
No suffix | Text input |
Default Values
Default values can be configured under Query Options → Config → Link Suffix.
?:parameter=defaultvalue
Built-in default functions:
CURRENTDATE()
CURRENTMONTH()
CURRENTYEAR()
CURRENTTIME()
Example
SELECT * FROM salaryplan WHERE formonth = :salary_month;
Config → Link Suffix:
?:salary_month=CURRENTMONTH()
Numeric Totals
To automatically calculate totals for numeric columns, add a *
before or after the column name.
SELECT staffid, amount* FROM salarygiven;
👉 Displays a total sum row for amount
.
Examples
Filter by Date
SELECT * FROM orders WHERE order_date = :order_date;
Filter by Month
SELECT * FROM salaryplan WHERE formonth = :salary_month;
Between Two Dates
SELECT * FROM transactions WHERE created_at BETWEEN :from_date AND :to_date;
Search by Text
SELECT * FROM staff WHERE name LIKE CONCAT('%', :staffname, '%');
Managing Queries
- Run Query – Execute and view results.
- Save Query – Store for future use.
- Edit Query – Modify saved reports.
- Export Query – Save to
.bato
file. - Export Results – Download data as PDF, Excel, or Print.
- API Link – Generate an endpoint for programmatic access.