dbvisual: one specification for forms, sheets and reports
A shared declarative model for querying, editing and presenting data in a local application.
dbvisual · visualdb repository · Version 1.1 · MIT open source
One model, three ways to work
We liked the approach taken by the VisualDB software. We chose to develop dbvisual to control its code and future development directly, and to make the project available to the community as open-source software.
The project addresses a recurring need: building interfaces over existing databases without rewriting queries and rules for every screen. A form works on one record, a sheet edits rows in batches, and a report presents aggregates. All three views share a typed JSON specification, the QuerySpec.
The specification describes the main table, columns, relationships, filters and parameters. A compiler translates it into a SQLAlchemy Core query with bound values. Renderers use the same model to build controls and organise results.

| View | Operation | Constraint |
|---|---|---|
| Form | Insert and edit one record | Field validation and submission rules |
| Sheet | Edit multiple rows and save a batch | Write only to the main table |
| Report | Filter, aggregate and group | Read-only query |
Separate querying from writing
Relationship columns are readable but do not automatically become editable. Writes concern the definition’s main table. This avoids ambiguous updates across several tables when a grid includes joins.
Batch saves use a transaction and optimistic locking to detect concurrent changes. In master-detail operations, the master and details commit together; a generated master key propagates to new detail records within the same operation.
The DDL channel is separate from report queries: the schema editor shows the SQL and requires confirmation before execution. The optional AI assistant proposes read-only report SQL; the text remains subject to review and is not executed automatically.
Local deployment and heterogeneous databases
The application is a Python monolith with a NiceGUI interface. The same code runs in a desktop window or as a local web application. Interface and services belong to one process; a separately deployed frontend and a cloud account are unnecessary.
The queried database can be local or remote. Connections, view definitions and application metadata remain on the installation machine. Additional drivers are installed for the databases actually needed: PostgreSQL, MySQL/MariaDB, SQL Server, Oracle, SQLite and DuckDB.
For PostgreSQL, row-security policies remain in the database. dbvisual passes the current identity to the session and delegates authorisation to the policies rather than duplicating their rules in the interface.
Results and checks
Saved views retain filters, grouping and column configuration. Reports support multilevel subtotals and self-contained HTML or Excel snapshots, preserving a point-in-time reading of the data.
Core tests use SQLite and DuckDB without external servers. Server-dialect tests are separate and require an explicitly configured connection: an installed driver is not treated as verification against that server.
The result is a shared path from definition to query and presentation, with distinct reading, editing and DDL channels. The repository is distributed under the MIT licence.