HTMQL File Format — HTMQL Documentation

HTMQL File Format

At a high level, every .htmql file contains a header section followed by the HTML content. The header section contains SQL commands organized in a format that controls when and how the application server will execute the SQL commands. The HTML content contains the page layout, frontend logic, and dynamic content available via {{template}} directives.

For example:

{{/*
+admin
-guests
GET:select * from table where id=@id;
*/}}
<title>Hello</title>
<h1>Hello {{username}}</h1>
<p>Welcome to the page!</p>

Here is some sample data:<br/>
<ul>
{{range .select}}
  <li>{{.field1}}: {{.field2}}</li>
{{else}}
  <li>Sorry, no data found</li>
{{end}}
</ul>