Local HubDB Example

See the full HubDB HubL documentation here

hubdb_table

Gets information on a table including its name, columns, last updated, etc...

{% set table_info = hubdb_table(1029037) %}

Showing information for table {{table_info.id}} ({{table_info.name}})

The table was created at {{table_info.created_at}} and has {{table_info.row_count}} rows

hubdb_table_row

Gets a single row

{% set single_row = hubdb_table_row(1029037, 6655243623) %}

Showing information for row {{single_row.hs_id}}

This row was created at {{single_row.hs_created_at}} and is named {{single_row.name}}

hubdb_table_column

Gets information on a column in a table such as its label, type, and options.

{% set column_info = hubdb_table_column(1029037, "multiselect_column") %}

Column ID {{column_info.id}} is named {{column_info.name}} with label {{column_info.label}} and type {{column_info.type}}

It has the options {{column_info.options}}

You can get an option by name, like so: {{column_info.getOptionByName("Option 1")}}

hubdb_table_rows

List multiple rows of a table

Rows, reverse sorted by numerical column limited to two results:

{% for row in hubdb_table_rows(1029037, "&orderBy=-number_column&limit=2") %}

the value for {{row.hs_id}} is {{row.number_column}}

{% endfor %}

Rows, filtered on a complex column type

{% for row in hubdb_table_rows(1029037, "&multiselect_column__in=3,4") %}

Selected row {{row.hs_id}} with multiselect value: {{row.multiselect_column}}

{% endfor %}

Row IDs, ordered randomly

{% for row in hubdb_table_rows(1029037, "&orderBy=random()") %}

{{row.hs_id}}

{% endfor %}