You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/features/autocomplete.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,10 @@ WHERE date_column > | -- NOW(), CURRENT_DATE, etc.
137
137
/>
138
138
</Frame>
139
139
140
+
### Favorite Keywords
141
+
142
+
Favorites you've assigned a keyword to (DB-stored or linked-file `@keyword` frontmatter) appear in the popup as a top-priority match. Type the keyword, accept the suggestion, and the favorite's full SQL replaces the keyword inline. See [SQL Favorites](/features/sql-favorites) for how to assign keywords.
|**Linked SQL Folders**| No | Folder paths are per-Mac. Link the same Git repo on each Mac after cloning. Cached file metadata (`linked_sql_index.db`) is also local. |
18
19
19
20
<Note>
20
21
Passwords are not synced by default. Enable **Password sync** under the Connections toggle to sync passwords via Apple's iCloud Keychain (end-to-end encrypted). With password sync off, you need to enter the password once on each new Mac.
Copy file name to clipboardExpand all lines: docs/features/sql-editor.mdx
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -294,3 +294,17 @@ The title bar shows the filename for file-backed tabs. A dot appears on the clos
294
294
When a tab has both unsaved file changes and pending data grid edits, `Cmd+S` saves the data grid changes first. Save the file after the grid save completes.
295
295
</Note>
296
296
297
+
### External modifications
298
+
299
+
If a file changes on disk while it's open in TablePro (a `git pull`, an edit in VS Code, etc.), a yellow banner appears above the editor with a one-click **Reload from Disk**. Reload pulls the new content in and discards your tab edits.
300
+
301
+
If you save (`Cmd+S`) while the file has changed externally, TablePro shows a side-by-side diff sheet with line-level highlighting and three actions:
302
+
303
+
-**Keep My Changes** writes your tab content back, overwriting the external edits.
304
+
-**Reload from Disk** drops your edits and loads the external version.
305
+
-**Cancel** closes the sheet without saving so you can copy parts out manually.
306
+
307
+
### Linked folders
308
+
309
+
For watching a whole folder of `.sql` files (e.g., a Git repo of team queries), use [Linked SQL Folders](/features/sql-favorites#linked-sql-folders) instead of opening each file by hand. Linked folders update the sidebar within a second of any on-disk change.
Copy file name to clipboardExpand all lines: docs/features/sql-favorites.mdx
+35-16Lines changed: 35 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,21 +72,30 @@ Set the scope when creating or editing a favorite.
72
72
73
73
## Linked SQL Folders
74
74
75
-
Point TablePro at a folder of `.sql` files on disk and they appear in the Favorites sidebar as read-from-disk items. Useful for teams sharing a Git repo of queries: anyone with the repo cloned can add the folder, and edits are picked up live.
75
+
Link a folder of `.sql` files on disk and they show up in the Favorites sidebar live. Useful for a Git repo of shared queries: clone the repo, link the folder, the team's queries appear next to your DB-stored favorites.
76
76
77
-
**Adding a folder**: in the Favorites sidebar, click the **+** button at the bottom and pick **Add Linked SQL Folder...** Pick any folder containing `.sql` files. Subfolders are watched recursively. You can add as many folders as you want.
77
+
### Adding a folder
78
78
79
-
**Managing folders**: right-click on a linked folder root in the sidebar to disable, reload, copy its path, show in Finder, or remove it from the sidebar. Removing only unlinks the folder. Files on disk are not deleted.
79
+
In the Favorites sidebar, click the `+` at the bottom and choose **Add Linked SQL Folder...** Pick any folder. Subfolders nest in the sidebar in the same shape as on disk. Add as many folders as you want, and assign each one to a specific connection or leave it global.
80
80
81
-
**Live updates**: Drop a new file into the folder and it appears within a second. Edit a file outside TablePro (vim, VS Code, `git pull`) and the sidebar refreshes automatically.
81
+
To set the scope, right-click an existing linked folder and use **Add Another SQL Folder...** to add more, or open Settings > Editor > Linked SQL Folders to toggle which connection each folder belongs to. Global folders show in every connection's Favorites tab. Per-connection folders show only when that connection is active.
82
82
83
-
**Editing**: Click a linked file to open it as a regular editor tab. ⌘S writes back to disk. If the file was modified externally since you opened it, ⌘S shows a prompt with **Keep My Changes** / **Reload from Disk** / **Cancel**.
83
+
### Editing files
84
84
85
-
**Deleting**: Press Delete on a linked file or right-click > **Move File to Trash**. The file goes to macOS Trash, recoverable from Finder.
85
+
Click a linked file to open it as a regular editor tab. `Cmd+S` writes back to disk in the file's original encoding. UTF-8, UTF-16, ISO Latin-1 and a few others are auto-detected on load and preserved on save.
86
+
87
+
If the file was modified outside TablePro since you opened it, two things happen:
88
+
89
+
- A yellow banner appears above the editor with a one-click **Reload from Disk**.
90
+
- If you save anyway, TablePro shows a side-by-side diff sheet with **Keep My Changes**, **Reload from Disk**, and **Cancel**.
91
+
92
+
External edits propagate to the sidebar within about a second via FSEvents. Drop a new file into the folder and it appears. Delete a file in Finder and the row disappears. `git pull` triggers the same refresh.
93
+
94
+
Non-UTF-8 files show a yellow warning triangle in the sidebar. Saving works in their native encoding. If you type a character that doesn't fit (e.g., an emoji into ISO Latin-1), the save fails with a clear error so you don't silently lose data.
86
95
87
96
### Frontmatter
88
97
89
-
Add metadata as leading SQL comments. The parser stops at the first non-matching line, so put frontmatter at the very top:
98
+
Top-of-file SQL comments set the display name, autocomplete keyword, and tooltip:
90
99
91
100
```sql
92
101
-- @name: Active Users (24h)
@@ -97,21 +106,31 @@ FROM users
97
106
WHERE last_seen > NOW() - INTERVAL 24 HOUR;
98
107
```
99
108
100
-
| Key | Description |
101
-
|-----|-------------|
102
-
|`@name`| Display name in the sidebar. Falls back to filename without `.sql`. |
103
-
|`@keyword`| Autocomplete keyword. Type it in the editor to expand the file content as a query. |
104
-
|`@description`| Optional description, shown in tooltips. |
109
+
| Key | Effect |
110
+
|-----|--------|
111
+
|`@name`| Display name in the sidebar. Falls back to the filename without `.sql`. |
112
+
|`@keyword`| Autocomplete trigger. Type the keyword in the editor and the file content expands as a query. |
113
+
|`@description`| Optional. Shown in tooltips. |
114
+
115
+
The parser stops at the first non-frontmatter line, so put these at the very top of the file. UTF-8 BOM at the start of the file is handled. Files without frontmatter still appear, with the filename as the display name and no keyword registered.
105
116
106
-
Files without frontmatter still show up. The filename becomes the display name and no keyword is registered.
117
+
To edit frontmatter without opening the file, right-click a linked row and choose **Edit Metadata...** The dialog rewrites only the leading comment block and preserves the rest of the file plus its original encoding.
107
118
108
-
### Folder scope
119
+
### Drag and drop
109
120
110
-
In the future, linked folders can be scoped per-connection (so each project repo is only visible when its database is selected). Today all linked folders are global.
121
+
Drag a row from the Favorites sidebar (linked or DB-stored) onto the SQL editor to insert its content at the cursor.
122
+
123
+
### Removing files and folders
124
+
125
+
Press Delete on a linked file or right-click > **Move File to Trash**. The file goes to the macOS Trash and stays recoverable from Finder.
126
+
127
+
Right-click a linked folder root for **Disable**, **Reload**, **Copy Path**, **Show in Finder**, **Add Another SQL Folder...**, or **Remove from Sidebar**. Removing only unlinks the folder from TablePro. Files on disk stay where they are.
111
128
112
129
### Storage
113
130
114
-
Linked folder paths are stored in UserDefaults (key `com.TablePro.linkedSQLFolders`). Parsed file metadata (name, keyword, mtime, size, encoding) is cached in `linked_sql_index.db` in `~/Library/Application Support/TablePro/` for fast sidebar rendering. The actual file content always lives on disk.
131
+
Linked folder paths live in UserDefaults under `com.TablePro.linkedSQLFolders`. Parsed metadata (name, keyword, mtime, size, encoding) is cached in `linked_sql_index.db` under `~/Library/Application Support/TablePro/` so the sidebar renders without re-reading every file. File content always lives on disk.
132
+
133
+
Linked folder paths are not part of iCloud Sync. Each Mac links its own copy of a shared repo.
0 commit comments