Abstract for Querier-services, cannot be used directly but rather as implemented by database-specific queriers.

What it does

When an implementation of this Service is hit, a query will be run, typically on a database.

It will branch depending on the size and influence of the executed query.

It is recommended to use the more generic SQL-service, so the database-connection may be elected based on the credentials.


MySqlQuerier Connects to MySQL-compatible database and allows querying in accordance to Querier-abstract
SQLiteQuerier Opens SQLite-database and allows querying in accordance to Querier-abstract

How it works

// This example uses the MySqlQuerier implementation

    plugins = [

    instances = {
        credentials = CredentialsStore(
            credset = "example",
            host = "localhost", db = "example",
            user = "example", pass = "example",
            pool = true);
        // Select Query producing text column
        list = MySqlQuerier(
            credset = "example"
        ) {
            // NoPies.html says there's no pies
            // {% text %} tag in OnePie.html
            // {% text %} tag in NPies.html

        // Insert Query using @text-parameter
        save = MySqlQuerier(f"queries/SetPie.sql",
            credset = "example",
            params = ["text"]
        ) {

        form = PostFieldReader(
            showformafter = true,
            field_text = "^.{1,250}$"
        ) {
            // Form with textarea named 'text'

        server = HttpService(
            prefixes = ["http://localhost:8080/"]
        ) {
            ) {
                // {% list %} tag in List.html
                // {% form %} tag in List.html


[default] or query a filesystem path to the query file that this service needs to execute
resultcap a numeric value indicating the maximal amount of result rows that should be accepted
params an array containing all string names of parameters used in this query. may be left empty if the query doesn't have parameters.
defaults default values for query parameters; these will be used if parameter names are not available in context


branch-name trigger interaction
none when no results have been produced from the query -
single when a single result has been produced ResultInteraction
first for the first result that has been produced ResultInteraction
iterator once for every result that has been produced ResultInteraction
successful after the query and subsequent branching was successful -
capreached after the resultcap has been reached -
noneAffected when the query has not changed the database -
oneAffected when the query has affected a single record -
someAffected when the query has affected some records -