Space lua/queries not working

I’ve migrated from v1 to v2 and I’m trying to replace my old queries but whenever I add something inside of ${this} it highlights the syntax but never actually turns into something. Am I doing something wrong? Is there something additional I need to do to get this to work?

Here are the ones I’ve tried so far, and they just show up as plain (but syntax highlighted) text:

${widgets.commandButton("System: Reload")}

${query[[
  from page
  where table.includes(tags, “utilities”)
]]}

Obvious question: are you actually running v2? What does Client: Version tell you? And, anything of interest in your browser’s JavaScript console?

“You are currently running SilverBullet 2.3.0-0-g21ddcb46”

Console says:

[Client] Booting SilverBullet client
client.js?v=cache-1763977725007:29 [Client] Boot config {spaceFolderPath: '/space', indexPage: 'index', readOnly: false, logPush: false, enableClientEncryption: false, …} {index: {…}, actionButtons: Array(3), plugs: {…}}
client.js?v=cache-1763977725007:29 [Client] Service worker registered...
service_worker.js:2 [Service Worker] Service worker already configured, just updating configs
service_worker.js:2 [Service Worker] [sync] Updated sync config: {syncDocuments: false, syncIgnore: ''}
client.js?v=cache-1763977725007:29 [Client] Using IndexedDB database sb_data_8ab93d7d371d783ebba7ea87c2979bf7e3f3507c1787d8d14c8a4c6fcd2664bc
client.js?v=cache-1763977725007:29 [Client] (Re)loading plugs
client.js?v=cache-1763977725007:29 [Client] All plugs (9) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]0: {name: 'Library/Std/Plugs/core.plug.js', created: 1763977747000, lastModified: 1763977747000, contentType: 'text/javascript; charset=utf-8', size: 4487, …}1: {name: 'Library/Std/Plugs/editor.plug.js', created: 1763977747000, lastModified: 1763977747000, contentType: 'text/javascript; charset=utf-8', size: 35457, …}2: {name: 'Library/Std/Plugs/emoji.plug.js', created: 1763977747000, lastModified: 1763977747000, contentType: 'text/javascript; charset=utf-8', size: 283466, …}3: {name: 'Library/Std/Plugs/image-viewer.plug.js', created: 1763977747000, lastModified: 1763977747000, contentType: 'text/javascript; charset=utf-8', size: 22223, …}4: {name: 'Library/Std/Plugs/index.plug.js', created: 1763977747000, lastModified: 1763977747000, contentType: 'text/javascript; charset=utf-8', size: 46249, …}5: {name: 'Library/Std/Plugs/plug-manager.plug.js', created: 1763977747000, lastModified: 1763977747000, contentType: 'text/javascript; charset=utf-8', size: 13344, …}6: {name: 'Library/Std/Plugs/search.plug.js', created: 1763977747000, lastModified: 1763977747000, contentType: 'text/javascript; charset=utf-8', size: 8459, …}7: {name: 'Library/Std/Plugs/sync.plug.js', created: 1763977747000, lastModified: 1763977747000, contentType: 'text/javascript; charset=utf-8', size: 10288, …}8: {name: 'Library/Std/Plugs/tasks.plug.js', created: 1763977747000, lastModified: 1763977747000, contentType: 'text/javascript; charset=utf-8', size: 24937, …}length: 9[[Prototype]]: Array(0)
client.js?v=cache-1763977725007:29 [Client] Activated plug core
client.js?v=cache-1763977725007:29 [Client] Activated plug editor
client.js?v=cache-1763977725007:29 [Client] Activated plug emoji
client.js?v=cache-1763977725007:29 [Client] Activated plug image-viewer
client.js?v=cache-1763977725007:29 [Client] Activated plug index
client.js?v=cache-1763977725007:29 [Client] Activated plug plug-manager
client.js?v=cache-1763977725007:29 [Client] Activated plug search
client.js?v=cache-1763977725007:29 [Client] Activated plug sync
client.js?v=cache-1763977725007:29 [Client] Activated plug tasks
client.js?v=cache-1763977725007:29 [Client] Not loading space scripts, since initial indexing has not completed yet
client.js?v=cache-1763977725007:29 [Client] Now navigating to index
client.js?v=cache-1763977725007:29 [Client] Focusing editor
client.js?v=cache-1763977725007:29 [Client] Loading snapshot and enabling events
client.js?v=cache-1763977725007:29 [Client] Booting up worker from /.fs/Library/Std/Plugs/editor.plug.js
client.js?v=cache-1763977725007:29 [Client] Updating page list cache
client.js?v=cache-1763977725007:29 [Client] Updating document list cache
client.js?v=cache-1763977725007:29 [Client] Booting up worker from /.fs/Library/Std/Plugs/index.plug.js
client.js?v=cache-1763977725007:29 [Client] Initial sync not complete or index plug not loaded. Fetching page list directly using space.fetchPageList().
client.js?v=cache-1763977725007:29 [Client] alreadyFetching is on, skipping even triggering for fetchFileList.

Two rookie mistakes:

  1. Instead of using left and right double quotation marks ( ), you should use " - Straight double quotes.
  2. you should also add index.tag "page" instead of only from page

Here is the corrected lua query:

${query[[
  from index.tag "page"
  where table.includes(tags, "utilities")
]]}

Here is also an exhaustive list (Thanks ChatGPT) with the different quotation characters, and where are they usually used:

Quote Name Typical Usage
" Straight double quote Programming, plain text, typewriter legacy
' Straight single quote / apostrophe Programming, contractions, measurements (informal)
Left double quotation mark Opening quotation in proper typography
Right double quotation mark Closing quotation in proper typography
Left single quotation mark Opening single quote, nested quotations
Right single quotation mark Closing single quote, apostrophes in typography
` Backtick / grave accent Code, Markdown, shell commands, template literals
Prime Minutes, feet, mathematical notation
Double prime Seconds, inches
« Left guillemet Opening quote in French, German, Romanian
» Right guillemet Closing quote in French, German, Romanian
Low double quotation mark Opening quote in German, Polish, Czech
Low single quotation mark Opening single quote in German
Left single guillemet / angle quote Nested quotes, Swiss typography
Right single guillemet / angle quote Nested quotes, Swiss typography

I have more troubleshooting: It appears to work fine in Chrome but not in Brave