Skip to content

Using properties

You can use properties to customise your queries and make them dynamic. This can be helpful if you plan to reuse your queries accross multiple files or use them in the templates.

You can refer to your properties by prepending them with an @ symbol, for example @year to refer to year property.

Built-in variables

On top of properties current file exposes in the properties, you can also use the following properties that will automatically get exposed:

PropertyDescriptionSample value
@pathFull path of the file you're editingfolder/file.md
@fileNameFilename with extensionfile.md
@basenameFilename without extensionfile
@parentPath of the parent folder (/ if none)folder
@extensionExtension of the file (without leading dot)md

Example 1: Selecting just the current file from the files table

SELECT * FROM files WHERE path = @path

Example2: Select tags of the current file

SELECT * FROM tags WHERE path = @path