dau: type those three letters in the editor and the whole statement expands, cursor already in place.
The Favorites tab holds databases, tables, saved SQL, a Team Library on a Team license, and any linked folders of .sql files.
Reach it from the Tables / Favorites control at the top of the sidebar, or from View > Show Favorites, which reveals a collapsed sidebar on the way. Neither command ships with a shortcut; bind one in Settings > Keyboard, under Navigation.
Database favorites
Start with the star. It lives only in the Tree layout (View > Sidebar as Tree), so use the menu bar in a flat list or from the keyboard.
The star files the database under Unassigned. A right-click sets the environment in one move: Add to Favorites > Production. Once a database is a favorite, that submenu reads Environment. Right-clicking inside a multiple selection acts on the whole selection.
In the Favorites tab, databases come first, one row per environment. The Environment menu narrows the list to one group; the search field filters by name. Double-click, or press
Return, to switch to a database. Right-click for Use as Active Database, a different environment, or Remove from Favorites. Delete removes it too.


Favorite databases grouped by environment
Table favorites
Hover a table row and click the star at its trailing edge, or right-click and choose Add to Favorites. A pinned row keeps its star, filled and yellow. Pinned tables sit under Tables in the Favorites tab. Double-click, or pressReturn, to open one. Its right-click menu has Open Table, View ER Diagram, and Remove from Favorites; Delete removes the selection.
Table favorites are scoped to the connection, database, and schema, and sync through iCloud. One whose table is missing from the database you are browsing is hidden rather than shown broken.
Recent tables
Turn on Show recent tables in General settings for a Recent section at the top of the object list. It holds the last 10 tables per connection and database, newest first, and stepping through preview tabs records only the one you stop on. Click a row to reopen the table. Right-click to remove one entry or clear the list. Recents stay on this Mac.Saving a query
The dialog takes a name, the SQL, and an optional keyword. Select Global for a query that names nothing specific to one database. Leave it off and the favorite belongs to the connection you are in, and goes with it when that connection is deleted.
Folders carry the same setting, so the Folder list offers only the ones that match: a global query goes in a global folder, a connection’s own query goes in either.


Creating a new SQL favorite
Keywords
A keyword is what you type instead of the query. Type its first letters, in any case, and the favorite appears in the completion popup with a star;Tab or Return inserts the SQL. See Autocomplete.
Two favorites that reach the same connection cannot share a keyword, and the dialog says so as you type.


Keyword expansion in the editor autocomplete
Cursor placement
Put;; in the SQL to say where the cursor lands. The marker is removed on insert:
orders., ready for a column name. Only the first ;; counts; without one it lands at the end.
Working with saved queries
Double-click a favorite, or pressReturn, to insert it into the editor. The right-click menu has Insert in Editor, Run in New Tab, Copy Query, Edit…, Show History, Move to, and Delete. Arrow keys move between rows, typing jumps to a name, and Delete asks first.
Folders come from the same background menu. A folder’s own menu has New Favorite…, New Subfolder, Rename, Global, and Delete Folder; deleting one moves what was inside up to the parent level. A global folder carries a globe, and Global changes that folder alone: the queries inside keep the scope they had, so mark them global too if you want them everywhere. Anything kept in a folder a connection cannot see is listed at that connection’s top level, whether it is a global query or a global subfolder. Drag a query or a linked file out of the sidebar to drop its SQL into the editor or another app.
Saved query versions
Each time a saved query’s SQL changes, the text it replaced is kept. That includes an edit arriving from another Mac through iCloud, so a sync that overwrites your change leaves it recoverable. Right-click a saved query and choose Show History. A tab opens with the versions down the left, newest first. Changes compares the selected version with the current SQL; Content shows it read-only, with Copy, Export…, and Open in Editor. Choose Restore This Version to put it back. The SQL it replaces becomes a version too, so a restore is undone the same way. Each query keeps its last 50 versions, on this Mac only: versions never sync. Renaming, moving, or changing a keyword records nothing, and deleting a saved query deletes its versions.Team Library
On a Team license the Favorites tab gains a Team Library section holding what your team published. Double-click one, or pressReturn, to run it in a new tab.
To publish your own, right-click empty space and choose Publish Saved Queries to Team… It replaces everything you published before. See Team Plan.
Linked SQL folders
Link a folder of.sql files on disk and they appear next to your saved queries. The point is a Git repo of shared queries: clone it, link it, and a git pull keeps the team current.
This is not Linked Folders, which watches a folder of shared
.tablepro connection files..sql, .psql, and .pgsql are indexed, subfolders nest the way they do on disk, and hidden files are skipped.
Linked folders are global, so every connection shows them. Only the first 4 KB of each file is read to build the sidebar, so a large repo stays cheap.
Editing files
Click a linked file to open it as an ordinary editor tab.Cmd+S writes back in the encoding the file was read with, detected from the file itself and falling back to UTF-8, then ISO Latin-1.
A file changed on disk gets the same banner and diff sheet as any other SQL file. Files added and removed outside TablePro reach the sidebar a second later.
A non-UTF-8 file carries a yellow warning triangle. Saving keeps its encoding, and a character it cannot represent, an emoji in an ISO Latin-1 file, fails the save with an error rather than dropping the character.
Frontmatter
Leading SQL comments set the name, the keyword, and the tooltip:
The parser stops at the first line that is not one of these, so they go at the very top. Keys are case-insensitive and a UTF-8 BOM is handled. A file without frontmatter appears under its filename with no keyword. The
;; cursor marker works here too.
Right-click a row and choose Edit Metadata… to change frontmatter without opening the file. The dialog rewrites the leading comment block and leaves the rest, and the encoding, alone.
Managing linked files
PressDelete on a linked file, or right-click and choose Move File to Trash: it goes to the macOS Trash and stays recoverable. The rest of that menu is Open in Editor, Edit Metadata…, Copy Query, and Show in Finder, plus the Git commands inside a repository.
A folder’s root row carries Show in Finder, Copy Path, Disable, Reload, Add Another SQL Folder…, and Remove from Sidebar. Removing unlinks the folder and leaves the files where they are.
Linked folder paths are the one part of Favorites that does not sync, so each Mac links its own copy.
Git status and history
When a linked folder sits inside a Git working copy, a changed file carries a letter at the end of its row. Hover it to see whether the change is staged.
A file with no letter matches its last commit. Letters refresh when a file changes, when the repository changes, and when you switch back to TablePro.


Comparing a commit of a linked file with the current version
- Show History opens a tab listing the commits that changed the file, following it across renames, up to the 200 most recent. The top row is the file on disk; select it to see what changed since the last commit.
- Restore This Version, in that tab, writes the selected commit’s text into the file. It asks first when the file has uncommitted changes, because those are lost.
- Discard Changes… puts the file back to its staged version, or to its last commit when nothing is staged. It cannot be undone.

