Skip to content
ispyisail edited this page Nov 26, 2026 · 7 revisions

The one-file project: .qetdb

A .qetdb file is a whole QElectroTech project in one SQLite file: no XML, no zip, nothing beside it. It is experimental and off by default, so the format may still change. Keep a .qet or .qetz copy of any project that matters. The other two formats are described in Project files.

What the format adds over .qet and .qetz:

Feature Section
The whole project in one file 1
A history of saves: who saved, when, what changed 2
Damage inside the file is repaired when it opens 3
Bridges drawn over terminals 4
Many projects read at once with SQL 5
Blocks of a newer version kept, not dropped 6

1. Turning it on

Tick Offer saving a project as one database file, .qetdb (experimental) under Settings β†’ General β†’ Projects. Save As then offers Project QElectroTech, one database file (*.qetdb) as a file type. The file open dialog lists .qetdb next to .qet and .qetz whether or not the setting is on, so a file someone sends you always opens.

Opening and saving a .qetdb was made faster in #1647, and a damaged one is refused instead of being half-read (#1687).


2. History of saves

A .qetdb can keep, inside itself, one entry per save: who saved, when, and what the save changed.

Open it from Project β†’ History of saves....

Control What it does
Keep a history of saves in this file Switches the history on. Switched off, the history already recorded is deleted after a confirmation; this cannot be undone.
Saves to keep The oldest saves are dropped at each save beyond this number. all keeps everything.
List: No., Saved, By, Changes One row per save. The first row of a project converted from .qet or .qetz reads History started.
Open as it was Opens the project as it was after the selected save, read-only.
Compare Shows what the selected save changed, or, with two saves selected, what changed between them.

In a project that is not a .qetdb the dialog only says that a history is kept only in a project saved as .qetdb.

Giving a client a copy without the history

File β†’ Export for delivery... writes a copy of the project without the history of its saves, so a client does not receive the names and dates of every save. The copy is made from the saved file: if the project has unsaved changes you are asked whether to save first. The suggested name is <project> - delivery.qetdb; the copy cannot overwrite the project's own file. Only a .qetdb has a history to leave out, so for other formats the command says so and does nothing.


3. Damage

A disk error, a USB stick pulled out or a sync tool can damage pages of a file. A .qetdb carries enough to repair itself: such a file opens as it was saved. If it cannot be repaired it is refused, and the dialogs of Saving safely offer the previous version or what can be read.


4. Bridges

The bridges drawn over terminals (Edit β†’ Add β†’ Draw a bridge, see Terminal strips) are kept in a .qetdb with the rest of the project: their colour, name, line width, limit, voltage text, the terminals each one holds and the sections drawn on each sheet. They are in the file's bridge_value table, one row per value, and come back when the file opens. A bridge added, changed or deleted is written at the next save, like a cable.

A .qetdb saved by a QElectroTech from before bridges were stored has none in it, and opens as before. A .qetdb with bridges, saved again by one of those older versions, loses them.


5. Reading many projects with --query

--query runs one SQL SELECT on the project database of each project you name, without opening a window:

qelectrotech --query "SELECT label, article FROM qet_devices" a.qet b.qetz c.qetdb
qelectrotech --query "SELECT label, article FROM qet_devices" a.qet b.qetz c.qetdb --json
  • Every row is printed with the file it came from first: CSV by default, a JSON array of objects with --json.
  • The query is read-only and must be a single SELECT, the same rule as qet.query() in scripting.
  • A .qetdb is read as it is, without opening the project. Setting QET_QUERY_OPEN_PROJECT=1 opens it like the other formats instead.
  • A file that cannot be opened or queried is reported on standard error, the others still run, and the exit code says whether any failed.

The views

Query these, not the tables behind them: their names and columns stay the same between versions. A later version only adds columns at the end.

View One row per Columns
qet_folios folio folio_number, folio, title, author, plant, location, revision, date, filename, folio_uuid, folio_group, folio_subgroup
qet_devices symbol folio_number, folio, position, label, plant, location, kind, sub_kind, function, description, designation, manufacturer, article, supplier, quantity, comment, symbol, device_uuid, folio_uuid, structure_id, model
qet_wires wire folio_number, folio, wire_number, from_device, from_terminal, to_device, to_terminal, colour, section, cable, bus, function, voltage, wire_uuid, from_device_uuid, to_device_uuid, from_structure_id, to_structure_id
qet_links cross-reference link_kind (contact or report), device, folio_number, folio, position, linked_device, linked_folio_number, linked_folio, linked_position, device_uuid, linked_uuid
qet_device_list device structure_id, plant, location, label, symbols, folios, folio_number, folio, position, articles, designation, description, head_uuid, model
qet_terminals terminal of a terminal strip strip_id, plant, location, strip, position, level, label, terminal_id, spare, folio_number, folio, element_uuid, strip_uuid, wires, connected_to
qet_cables cable structure_id, plant, location, designation, type, cores, drawn_cores, wired_cores, length, folios, folio_number, folio, cable_uuid
qet_cable_cores core of a cable structure_id, plant, location, designation, position, core, wire_number, section, colour, from_structure_id, from_terminal, to_structure_id, to_terminal, folio_number, folio, cable_uuid, wire_uuid
qet_plc_io entry of a PLC's inputs and outputs table structure_id, plant, location, plc, article, entry, address, type, function, comment, plc_folio_number, folio_number, folio, position, plc_uuid, slave_uuid
qet_locations plant and location in use plant, location, structure_id, symbols, folios, first_folio_number, higher_plant, higher_location
  • plant and location are a symbol's own, else those of the smallest structure box it is drawn in, else its folio's. The same rule gives the structure_id of qet_devices, qet_device_list and both ends of qet_wires, also for folios not opened yet. Without a structure box nothing differs from "the symbol's own, else its folio's".
  • structure_id is the full reference designation, IEC 81346: =plant+location-label (for a cable, -designation). Each end of a wire has its own (from_structure_id, to_structure_id).
  • qet_device_list counts a device once however many symbols draw it: a coil and its contacts are one device. symbols and folios say how many, and the folio and position are those of the coil, else of its first symbol.
  • qet_terminals lists the terminals of each terminal strip in the order of the strip, position and level counted from 0 as the terminal strip editor shows them. spare is 1 for a terminal drawn on no folio. wires are the wire numbers on the terminal, connected_to what those wires reach.
  • qet_cables counts the cores a cable's type has (cores), the ones drawn (drawn_cores) and the ones on a wire (wired_cores).
  • qet_cable_cores lists every core of every cable, spare ones included (their wire columns empty), with the wire it is on and both its ends.
  • qet_locations lists each plant and location of the project once, with the number of symbols in it (folio reports left out), the number of folios that show it and the first of them. A row with empty plant and location is what has neither. A folio counts under every place it shows, so do not add up folios over the rows. It is what the Plants and locations window reads; scripts and AI assistants can query it too.
  • qet_plc_io lists every entry of a PLC's table, with the symbol linked to it where one is drawn (empty when none). type is DI, DO, AI, AO, UI or UO.

Example, the parts of every project in a folder, with the project each row came from:

qelectrotech --query "SELECT label, manufacturer, article FROM qet_devices WHERE article <> ''" \
    plans/*.qet* --json > parts.json

The terminal list of one strip, in order:

qelectrotech --query "SELECT position, label, folio FROM qet_terminals WHERE strip = '-X1'" plan.qet

6. Blocks this version does not know

A project saved by a newer QElectroTech, or by a fork, can hold XML blocks this version has never heard of, directly under the project or under a folio. They are kept whole in a foreign_block table and written back at every save and export, in .qet, .qetz and .qetdb, instead of being dropped. Nothing changes for files without such blocks. Tags that earlier versions wrote and later versions deliberately stopped writing (defaultcoductor, autonum) are still dropped.

Added in #1724.


See also

Checked against build b49ce16c4 on 2026-11-27 (read from source: the labels, menus and defaults in the sections added on 2026-11-27, checked against that build's source; not run).

Getting Started

Home

🌐 Languages β€” English Β· FranΓ§ais Β· Deutsch

Downloads

Windows without admin rights β€” the portable archive, no installer

Quick Start Guide

User Manual

FAQ

Tips & Tricks

Guides

Conductors β€” wire properties, what feeds which export, cables, and hops where wires cross

Wires per terminal β€” limit the wires on a terminal, chain wiring instead of stars

Printing and exporting β€” paper, PDF, images, and what each path does differently

Linking elements β€” master, slave, terminal

PLC modules β€” I/O tables and linking a wire to a specific point

Using the element editor β€” drawing tools, saving, checks

Generic devices β€” a quick box symbol with terminals on any side, made by a wizard

Grid size and element size β€” why symbols aren't all the same scale, and scaling one without leaving the grid

Preferences reference β€” what each settings page does

Saving and loading settings β€” your whole setup in one file, to copy or keep

Keyboard-only control β€” mouseless QET, and what still needs a mouse

Mouse modifiers β€” what Shift, Ctrl and Alt change while you drag

3D mouse β€” SpaceMouse pan, zoom and buttons

Aligning items β€” snap symbols back to the grid, or line them up

Drawing aids β€” dark mode, snap and grid step, crosshair, dimensions, the tape measure

Symbols already on the sheet β€” select the same symbols, replace them, show a T-junction as a dot, update placed copies from the collections

Symbol texts β€” place the texts at nine points, fixed or free size, format painter, title block cells, GOST ESKD, %T

Wiring tools β€” automatic connections, the Connections toolbar, chained folio reports, a cable across wires

Symbols and parts β€” edit several symbols, relay contact display, grouped parts list

Device types β€” what a device is made of: check, place and change its parts, Device Navigator

Project languages and checks β€” languages in a project, cell origin, duplicate labels, the Check panel

Reports and lists β€” project lists to CSV/PDF, tables on a folio, label-printer export, symbol list

Pictures on a sheet β€” labels, crop, transparency, what they cost in the file

Arcs and curved wires β€” the Arc tool, pulling an arc in or out, rounding a corner with a fillet, dashed arcs for lighting layouts

Grouping items β€” select, move and copy several items as one

Finding your place on a sheet β€” go to a cell like B13 or 4-B7, keep the headers in sight, show the cell limits, zoom and pan

Showing and hiding kinds of items β€” hide texts, wire numbers, shapes, pictures, tables or cross-references on every sheet

Drawing faster β€” place without dragging, the S shortcut bar, command search, gestures

Customising QElectroTech β€” keys, toolbar size and contents, the gesture ring

Managing collections β€” folders, writability, building your own shortlist

Templates β€” reusable multi-element blocks, placed by double-click or drag

Search & Replace β€” bulk property changes

Building a nomenclature query β€” the BOM/summary table builder

Formula columns β€” build a calculated column in a parts list without writing SQL

Linking wires across pages β€” sheet reports

Variables & formulas β€” %f, %{label}, sequences

Auto-numbering β€” schemes, sequences, freezing

Terminal strips β€” strips, levels, bridges

Connectors β€” plugs and sockets as terminal strips or head-with-pins devices, device types, pin check, spare-pin plans

Title block templates β€” the .titleblock format

Title block alignment β€” place a title block inside or outside the sheet, left, centred or right

Plants and locations β€” list, rename, copy a plant, suggestions

Designations and structure boxes β€” IEC 81346 names, structure boxes, ==/++ levels, folio groups, company prefixes

Revisions, document kinds and drawing standard β€” revision list and table, IEC 61355 document kind, project standard

Importing EPLAN parts (.edz) β€” EPLAN Data Portal

DXF import & export β€” two unrelated features, one format; command-line export and layers

Project files β€” .qetz (zipped, the default) and .qet, what is inside, opening big projects faster, starting from a template

The one-file project, .qetdb β€” history of saves, repair, --query over many projects

Saving safely β€” previous versions, a project open elsewhere, damaged files, crash recovery

The project database β€” the working SQLite database built when a project opens

File formats
Elements XML
Project XML
Development

Building from Source

Contributing Code

Code style β€” the QET house style for C++, and formatting only the lines you change

Fix or add with an AI assistant β€” beginner build setup and a prompt that does the work

Check your change: qet-verify β€” run it before every pull request

Posting with an AI assistant β€” short, plain pull requests and replies

Translate with an AI assistant β€” draft the interface in your language, check it, send it

Making a how-to video β€” a short feature video from a checked story

Writing wiki pages with an AI assistant β€” the rules, and a checker to run before you push

Automating QET β€” CLI, XML formats, external tools

CLI Reference β€” command line usage

JavaScript Scripting β€” --run, geometry editing, undo

MCP server β€” let an AI assistant read, verify and edit projects

Connecting an AI assistant β€” setup for Claude, Copilot, Gemini, Codex, Cursor, LM Studio

Script buttons β€” stored scripts with an icon, by hand or by an assistant

Live mode β€” an assistant working in the open project while you watch

Macro recorder β€” record a task by hand, for an assistant to script

Development Roadmap

Vision β€” proposal, under discussion

Developer Tools

About

Features

History

Community

License

Contributing to this Wiki

Clone this wiki locally