Skip to main content

Query Parameters

Instead of editing your SQL every time you want to test a different value, use :name placeholders. TablePro detects them, shows a panel for entering values, and executes using prepared statements.
Query parameters

Query parameter panel

Usage

Write a query with :name placeholders:
Press Cmd+Enter. A panel appears with a field for each parameter. Fill in values, press Cmd+Enter again. Done. Works with Execute All (Cmd+Shift+Enter) too.

The Panel

Each row has: Rows appear in the order the names first appear in your SQL. Clear All empties all value fields. The X button hides the panel. It comes back on the next execute if the query still has parameters. Every parameter needs a value or the NULL checkbox. Executing with an empty value shows “Missing value for parameter: :name” instead of running.

What Gets Detected

:name is detected when name starts with a letter or underscore. These are ignored: If the same name appears twice (:id = :id), both get the same value.

How Binding Works

TablePro converts your :name placeholders to the database’s native format before executing:
  • MySQL, SQLite: ? placeholders via mysql_stmt_bind_param / sqlite3_bind_text
  • PostgreSQL: $1, $2 via PQexecParams
  • DuckDB: $1, $2 via prepared statements
  • ClickHouse, SQL Server, others: client-side substitution with proper escaping
This is real prepared statement binding, not string replacement. Quoting and SQL injection are handled for you.

Values Stick Around

Parameter values are saved with the tab. They survive tab switches, app restarts, and show up in query history. When you edit the query and change parameter names, new names get empty fields and old ones disappear. Names that still match keep their values.

Multiple Statements

For multi-statement scripts, all unique parameter names across all statements appear in one panel. Each statement only binds the parameters it uses.
Both use :id. Only the INSERT uses :name.

Safe Mode

Parameterized queries still go through safe mode checks. DROP, DELETE without WHERE, and TRUNCATE still ask for confirmation.

Settings

Settings > Editor > Query parameters (:name syntax). On by default. Turn it off if you don’t want parameter detection (:name will be sent to the database as-is).