Query parameters
functionalWrite :id, ? or $1 where a value goes, type the value above the results, and run without editing the SQL.
Write a placeholder where a value goes, type the value once in the strip above the results, and run. Change the value and run again: the script itself never changes, so a query you reuse every day stays a query you can save, share and keep in version control.
SELECT *
FROM beneficiaries
WHERE id = :id;
As soon as the editor holds :id, a Parameters strip opens between
the editor and the results with one input for it. Type 42, press
Run (Cmd+Enter / Ctrl+Enter), and
SQLly sends WHERE id = 42. It works the same on every database SQLly connects to.


Placeholder styles
:name- A named placeholder, on every engine. Use the same name twice and it is one input:
WHERE a.client_id = :client_id OR b.client_id = :client_id. Names are not case-sensitive, so:IDand:idshare a value. ?- A positional placeholder, on every engine except PostgreSQL (where
?is a JSON operator). The strip lists them as?1,?2… in the order they appear in the script, and keeps that numbering when you run just one statement. SQLite's numbered form,?3, keeps its own number. $1- PostgreSQL and DuckDB's numbered placeholder.
$1used twice is one input. @name- SQL Server's own parameter style. An
@namethe script never declares, such asWHERE CustomerID = @CustomerId, gets an input like any other placeholder. Variables the script binds itself are left alone: anything in aDECLARElist (table variables too), the target ofSET @x,SELECT @x =orFETCH … INTO @x, the parameter names inEXEC dbo.Proc @Id = …,@@ROWCOUNT-style functions, and every name in a script that creates a procedure, function or trigger (Procedure mode fills those). On MySQL@nameis a user variable and never asks for a value.




How a value is sent
Values are turned into a literal your database understands and escaped for it, so a quote,
a backslash or a ' OR '1'='1 in a value is only ever data. What you type decides
the kind of value:
- Numbers
42,-3.5and1e6go in as numbers. A number with a leading zero, like a postcode007, stays text.true/false- Booleans, written the way your engine spells them (
1/0on SQL Server and MySQL). NULL- SQL NULL. An empty input is never NULL: it is missing, and Run asks for it.
- Anything else
- Text, quoted for your engine:
activebecomes'active'. 'quoted'- Wrap a value in single quotes to force text:
'42'sends the string 42, and''sends an empty string.
int_col = :id and text_col = :id both work with the same input.Only the statement you run needs values
The strip lists every placeholder in the script, so you can fill values in ahead of time. When you run, only the placeholders in what is actually running (the selection, or the current statement) need a value. If one is empty, nothing is sent: the status bar names it, its row says required, and the cursor jumps into it.


Explain and the query plan commands use the same values, so a plan is for the query you will really run.
Give a placeholder a type and a default
A -- sqlly param: line types a placeholder: the input is checked before Run, and
an empty input falls back to the default.
-- sqlly param: :since date = 2026-01-01
-- sqlly param: :limit int = 50
SELECT * FROM orders WHERE created_at >= :since LIMIT :limit;
Types are text, int, decimal, bool,
date, datetime, time, uuid, json
and binary. The same line with an @name declares a parameter that
SQLly substitutes for @name itself; see SQLly
directives.
What is never a placeholder
SQLly reads your SQL the way your database does, so it does not ask for values that are not
parameters: anything inside a string, a comment, a quoted name or a PostgreSQL
$$ function body; :: casts; array slices such as
arr[lo:hi]; JSON paths such as metadata:country; MySQL's
:= and loop labels; SQL Server sqlcmd lines such as :setvar; and
Oracle's :new / :old in triggers.
Values stay with the tab
Typed values are saved with the tab, travel with it to another window, and come back when SQLly starts again. For named placeholders, recently used values appear as one-click chips beside the input, and the formatter leaves placeholders exactly as written.
-- sqlly param: lines keep working.