{{extend 'layout.html'}} {{if request.function=='index':}}

Available databases and tables

{{if not databases:}}No databases in this application{{pass}} {{for db in sorted(databases):}} {{for table in databases[db].tables:}}

{{=A("%s.%s"%(db,table),_href=URL(r=request,f='select',args=[db],vars=dict(query='%s.%s.id>0'%(db,table))))}}

[ {{=A('insert new '+table,_href=URL(r=request,f='insert',args=[db,table]))}} ]

{{pass}} {{pass}} {{elif request.function=='select':}}

database {{=A(request.args[0],_href=URL(r=request,f='index'))}} select

{{if table:}} [ {{=A('insert new %s'%table,_href=URL(r=request,f='insert',args=[request.args[0],table]))}} ]

Rows in table


{{else:}}

Rows selected


{{pass}} {{=form}}

The "query" is a condition like "db.table1.field1=='value'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.
Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.
"update" is an optional expression like "field1='newvalue'". You cannot update or delete the results of a JOIN



{{=nrows}} selected

{{if start>0:}}[ {{=A('previous 100 rows',_href=URL(r=request,f='select',args=request.args[:1],vars=dict(start=start-100)))}} ]{{pass}} {{if stop {{linkto=URL(r=request,f='update',args=request.args[:1])}} {{upload=URL(r=request,f='download',args=request.args[:1])}} {{=SQLTABLE(rows,linkto,upload,orderby=True,_class='sortable')}} {{pass}}

Import/Export


[ export as csv file ] {{if table:}} {{=FORM('or import from csv file ',INPUT(_type='file',_name='csvfile'),INPUT(_type='hidden',_value=table,_name='table'),INPUT(_type='submit',_value='import'))}} {{pass}} {{elif request.function=='insert':}}

database {{=A(request.args[0],_href=URL(r=request,f='index'))}} table {{=A(request.args[1],_href=URL(r=request,f='select',args=request.args[:1],vars=dict(query='%s.%s.id>0'%tuple(request.args[:2]))))}}

New Record


{{=form}} {{elif request.function=='update':}}

database {{=A(request.args[0],_href=URL(r=request,f='index'))}} table {{=A(request.args[1],_href=URL(r=request,f='select',args=request.args[:1],vars=dict(query='%s.%s.id>0'%tuple(request.args[:2]))))}} record id {{=A(request.args[2],_href=URL(r=request,f='update',args=request.args[:3]))}}

Edit current record



{{=form}} {{elif request.function=='state':}}

Internal State

Current request

{{=BEAUTIFY(request)}}

Current response

{{=BEAUTIFY(response)}}

Current session

{{=BEAUTIFY(session)}} {{pass}}