SQL queries

The user interface provides the Query Selection dialog box in order to select messages matching criteria such as sender, date, tags, subject, etc.

Internally, these criteria are used to build SQL queries. However, since the criteria offered by the user interface cannot cover every possible user need, Manitou-Mail allows user-defined SQL queries.

These user queries must return a list of mail_id. The mail_id is the primary key of the MAIL table, meaning that it is the value that uniquely identifies each message. A user query will be combined with other criteria if submitted, and used as a subquery inside a SQL IN () construct.

Examples of queries:

Each time a query is run and the results are available, it is possible to use the [Selection/Modify Query] command to return to the selection form, modify the SQL and run again. When no results are available or the query yields an error, the selection form stays on top and a message describing the problem is displayed.