Spanish Total.js
English
Documentation For AI agents
Contents

Write and run queries

Write SQL in the dialect of your database, run all of it or a part, and keep what you want to use again.

.md GitHub
On this page

Run it

  1. Press Query, or ⌘T on the Mac and Ctrl+T on Windows and Linux. A connection opens with a query ready.
  2. Write one or more statements. The editor offers the words of SQL and the names of your tables.
  3. Press Run, or ⌘↵ on the Mac and Ctrl+Enter on Windows and Linux.

If you have selected text, only that runs. If not, everything does.

Statements that change data may ask first: it depends on the care level. A SELECT may ask too, when a function that it calls changes data: the statements after it wait for your answer.

Scripts with GO (SQL Server) and DELIMITER (MySQL and MariaDB) are understood. In SQL Server, a function, a procedure or a trigger goes on until the next GO.

Read the results

Each statement has its result, with its rows or how many it changed, and its time. With several statements, there is a tab for each.

If one fails, those after it do not run, and those before it stay done. To undo them together, write your own transaction.

A result keeps 200 000 rows at most, and says when more were left out. Its columns move as those of a table. You can see the row on the side, only to read.

Copy the result, to paste in a spreadsheet copies all of it with the names of the columns. Export… saves it to a file.

Stop it

Press Stop while it runs. A connection runs one statement at a time, so its tables wait until a long query ends. In SQL Server, stopping connects again: temporary tables and open transactions are lost.

Open a SQL file

Open a SQL file… adds the text of a .sql or .txt file, in UTF-8 and of 8 MB at most, to the query. Nothing runs until you press Run.

Find an earlier one

History has the statements run on this connection, with their time and whether they failed. Write in Search to find one, and press it to add it to your query. The last 2000 are kept, and the dialog shows the 200 newest that match.

The history keeps statements as you wrote them, also a password inside one. Clear history deletes it all.

Keep a query

Press Save this query… and write a name. Saved queries has those of this connection: press one to add it to the query.

A saved query is not changed in place. Save the new text, and delete the old one.

The text of a query goes away with its tab. If it is nowhere else (it is not saved, and not all of it has run and is in the history), TotalSQL asks before you close the tab, the connection or the window, and when you quit from the menu.

Made in Europe