1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
//! CREATE TRIGGER and DROP TRIGGER statement parsers
use super::{ParseError, Parser};
use crate::{keywords::Keyword, lexer::Lexer, token::Token};
/// SQLite's verbatim error when a `CREATE TRIGGER` body (or its WHEN clause)
/// references a bound parameter / variable. A trigger program is compiled once
/// when the trigger is created and has no bind context at fire time, so SQLite
/// rejects any variable reference at create time (see triggerE.test).
const TRIGGER_CANNOT_USE_VARIABLES: &str = "trigger cannot use variables";
impl Parser {
/// Parse CREATE TRIGGER statement
///
/// Syntax:
/// CREATE [TEMP | TEMPORARY] TRIGGER trigger_name
/// [{BEFORE | AFTER | INSTEAD OF}] {INSERT | UPDATE | DELETE}
/// ON table_name
/// [FOR EACH {ROW | STATEMENT}]
/// [WHEN (condition)]
/// triggered_action
///
/// Note: BEFORE/AFTER/INSTEAD OF is optional; defaults to BEFORE (SQLite compatibility)
pub(super) fn parse_create_trigger_statement(
&mut self,
) -> Result<vibesql_ast::CreateTriggerStmt, ParseError> {
// Expect CREATE keyword
self.expect_keyword(Keyword::Create)?;
// Optional TEMP/TEMPORARY modifier (SQLite places such a trigger in the
// session `temp` schema). We record that as `schema = Some("temp")` so
// the trigger is registered against the temp schema, mirroring how a
// temp table/index shadows its main-schema namesake (triggerD-3.x).
let is_temp =
self.try_consume_keyword(Keyword::Temp) || self.try_consume_keyword(Keyword::Temporary);
// Expect TRIGGER keyword
self.expect_keyword(Keyword::Trigger)?;
// Optional IF NOT EXISTS: when present, creating a trigger whose name
// already exists is a no-op success instead of an error (SQLite).
let if_not_exists = if self.peek_keyword(Keyword::If) {
self.advance(); // consume IF
self.expect_keyword(Keyword::Not)?;
self.expect_keyword(Keyword::Exists)?;
true
} else {
false
};
// Parse trigger name, allowing an optional schema qualifier
// (`CREATE TRIGGER main.r1 ...` / `CREATE TRIGGER temp.r1 ...`). The
// table-ref helper also accepts a keyword schema (`temp`, `main`).
// Capture the verbatim source spelling of the trigger-name token before
// `parse_table_ref` normalizes (de-quotes) it. SQLite echoes the trigger
// name exactly as written — including its quoting form — in the
// "trigger ... already exists" error (trigger1-1.2.2/1.2.3), whereas
// `trigger_name` below holds the de-quoted identifier used for catalog
// lookups. For a `schema.name` qualified reference, the trigger-name
// token is the one following the `.` separator, so we record the cursor
// position of the *final* identifier token consumed by the table ref.
let name_start_pos = self.current_position();
let name_ref = self.parse_table_ref()?;
let trigger_name = name_ref.name;
// The trigger-name identifier is the last token before the cursor now.
// (`schema . name` consumes three tokens; `name` consumes one.)
let name_token_pos = self.current_position().saturating_sub(1).max(name_start_pos);
let name_source = self.token_source_at(name_token_pos).map(str::to_string);
// Resolve the trigger's schema. An explicit `schema.` prefix wins; if
// absent, the `TEMP`/`TEMPORARY` modifier implies the `temp` schema.
// SQLite forbids combining `CREATE TEMP TRIGGER` with an explicit
// non-temp schema (e.g. `CREATE TEMP TRIGGER main.r1`); reject that.
let schema = match (is_temp, name_ref.schema_name) {
(_, Some(schema_name)) => {
if is_temp && !schema_name.eq_ignore_ascii_case("temp") {
return Err(ParseError {
message: format!(
"temporary trigger may not have qualified name: \"{}.{}\"",
schema_name, trigger_name
),
});
}
Some(schema_name)
}
(true, None) => Some("temp".to_string()),
(false, None) => None,
};
// Parse timing: BEFORE | AFTER | INSTEAD OF (optional, defaults to BEFORE per SQLite)
let timing = if self.try_consume_keyword(Keyword::Before) {
vibesql_ast::TriggerTiming::Before
} else if self.try_consume_keyword(Keyword::After) {
vibesql_ast::TriggerTiming::After
} else if self.try_consume_keyword(Keyword::Instead) {
self.expect_keyword(Keyword::Of)?;
vibesql_ast::TriggerTiming::InsteadOf
} else {
// SQLite allows omitting the timing, defaulting to BEFORE
// Check if next token is an event keyword (INSERT, UPDATE, DELETE)
if self.peek_keyword(Keyword::Insert)
|| self.peek_keyword(Keyword::Update)
|| self.peek_keyword(Keyword::Delete)
{
vibesql_ast::TriggerTiming::Before
} else {
return Err(ParseError {
message: "Expected BEFORE, AFTER, INSTEAD OF, or event (INSERT/UPDATE/DELETE) after trigger name".to_string(),
});
}
};
// Parse event: INSERT | UPDATE [OF columns] | DELETE
let event = if self.try_consume_keyword(Keyword::Insert) {
vibesql_ast::TriggerEvent::Insert
} else if self.try_consume_keyword(Keyword::Update) {
// Check for optional OF column_list
//
// Standard SQLite (3.51.0) uses an UNPARENTHESIZED comma-separated
// column list terminated by ON:
// CREATE TRIGGER tr AFTER UPDATE OF c, d ON tbl ...
// SQLite itself rejects the parenthesized form `UPDATE OF (c, d)`.
// VibeSQL accepts BOTH: the standard unparenthesized form for
// conformance (trigger2-3.x), and the parenthesized form as a
// lenient extension (it was previously the only accepted form).
let columns = if self.try_consume_keyword(Keyword::Of) {
let mut cols = Vec::new();
// Optional opening paren (lenient extension; not valid SQLite).
let has_paren = if matches!(self.peek(), Token::LParen) {
self.advance();
true
} else {
false
};
loop {
let col = self.parse_identifier()?;
cols.push(col);
if matches!(self.peek(), Token::Comma) {
self.advance();
} else {
break;
}
}
if has_paren {
self.expect_token(Token::RParen)?;
}
// For the unparenthesized form the column list runs until ON,
// which is consumed by `expect_keyword(On)` further below.
Some(cols)
} else {
None
};
vibesql_ast::TriggerEvent::Update(columns)
} else if self.try_consume_keyword(Keyword::Delete) {
vibesql_ast::TriggerEvent::Delete
} else {
return Err(ParseError {
message: "Expected INSERT, UPDATE, or DELETE after trigger timing".to_string(),
});
};
// Expect ON keyword
self.expect_keyword(Keyword::On)?;
// Parse table name
let table_name = self.parse_identifier()?;
// Parse optional FOR EACH ROW.
//
// SQLite's grammar only accepts `FOR EACH ROW`; there are no
// statement-level triggers. Anything else after `FOR EACH` (most
// notably `STATEMENT`) is a syntax error in SQLite — e.g.
// `near "STATEMENT": syntax error` (trigger1-1.1.3). We surface the
// same `near "<tok>": syntax error` so the rejection matches SQLite
// rather than silently accepting an unsupported granularity.
let granularity = if self.try_consume_keyword(Keyword::For) {
self.expect_keyword(Keyword::Each)?;
if self.try_consume_keyword(Keyword::Row) {
vibesql_ast::TriggerGranularity::Row
} else {
return Err(ParseError { message: self.peek().syntax_error() });
}
} else {
// Default to ROW for SQLite compatibility (all SQLite triggers are
// FOR EACH ROW, whether or not the clause is written).
vibesql_ast::TriggerGranularity::Row
};
// Parse optional WHEN condition
// SQLite syntax: WHEN expression (no parens required)
// PostgreSQL syntax: WHEN (expression) (parens required)
//
// We delegate to the full expression parser, which natively handles
// both forms: a bare condition (`WHEN new.a > 20`), a parenthesized
// condition (`WHEN (new.a > 20)`), AND a leading subquery
// (`WHEN (SELECT count(*) FROM tbl) = 0`, trigger2-3.2). Consuming the
// opening paren ourselves as an optional PostgreSQL-style wrapper would
// mis-handle the subquery case — the `(` belongs to the subquery, so
// stripping it leaves `SELECT ... ) = 0`, which the expression parser
// (rightly) rejects. Letting `parse_expression` see the `(` lets its
// scalar-subquery / parenthesized-expression handling do the right thing.
let when_condition = if self.try_consume_keyword(Keyword::When) {
// The WHEN condition is part of the trigger-program, so SQLite
// permits RAISE() there too. Mark the parser as inside a trigger
// body for the duration of the WHEN expression so RAISE() is
// admitted (it is rejected at parse time everywhere else).
let prev_in_trigger_body = self.in_trigger_body;
self.in_trigger_body = true;
let expr_result = self.parse_expression();
self.in_trigger_body = prev_in_trigger_body;
let expr = expr_result?;
// SQLite rejects a bound parameter / variable in the WHEN clause at
// create time (triggerE-1.1.1: `WHEN new.a = ?`). NEW/OLD column
// references are *not* variables and must still be allowed.
if Self::expression_references_variable(&expr) {
return Err(ParseError {
message: TRIGGER_CANNOT_USE_VARIABLES.to_string(),
});
}
Some(Box::new(expr))
} else {
None
};
// Parse triggered action
// For now, we'll store the action as raw SQL
// We expect BEGIN...END block or a simple statement
let triggered_action = self.parse_trigger_action()?;
// Expect semicolon or EOF
if matches!(self.peek(), Token::Semicolon) {
self.advance();
}
Ok(vibesql_ast::CreateTriggerStmt {
if_not_exists,
schema,
trigger_name,
name_source,
timing,
event,
table_name,
granularity,
when_condition,
triggered_action,
})
}
/// Parse triggered action (simplified: just collect tokens until semicolon or EOF)
fn parse_trigger_action(&mut self) -> Result<vibesql_ast::TriggerAction, ParseError> {
// Simplified implementation: store raw SQL as a string
// A full implementation would parse procedural SQL (BEGIN...END blocks)
// Expect BEGIN keyword
self.expect_keyword(Keyword::Begin)?;
let mut sql_parts = vec!["BEGIN".to_string()];
// Track block nesting. Both `BEGIN ... END` and `CASE ... END` open a
// block that `END` closes. The trigger body's terminating `END` is the
// one that brings the depth back to 0; a `CASE ... END` *expression*
// inside a body statement (e.g.
// `SELECT CASE WHEN NEW.id = 1 THEN raise(IGNORE) END;`) must not be
// mistaken for it, or the body is truncated at the CASE's `END`.
let mut depth = 1;
// Collect tokens until the matching body-terminator END.
loop {
match self.peek() {
Token::Keyword { keyword: Keyword::Begin, .. } => {
sql_parts.push("BEGIN".to_string());
depth += 1;
self.advance();
}
Token::Keyword { keyword: Keyword::Case, .. } => {
// A CASE expression opens a block its own END closes.
sql_parts.push("CASE".to_string());
depth += 1;
self.advance();
}
Token::Keyword { keyword: Keyword::End, .. } => {
sql_parts.push("END".to_string());
depth -= 1;
self.advance();
if depth == 0 {
break;
}
}
Token::Eof => {
return Err(ParseError {
message: "Unexpected end of input in trigger action".to_string(),
});
}
token => {
// Convert token back to valid SQL using to_sql()
sql_parts.push(token.to_sql());
self.advance();
}
}
}
let raw_sql = sql_parts.join(" ");
// Validate the body statements at CREATE TRIGGER time. SQLite
// parses every trigger-body statement when the trigger is created
// and rejects create-time errors then — e.g. `NULLS FIRST/LAST` in
// a conflict target / index position (nulls1.test 3.1.12) — rather
// than deferring them to fire time. VibeSQL stores the body as raw
// SQL (`RawSql`) and previously surfaced no error until fire time.
//
// We re-parse each body statement with the same `parse_sql` entry
// point the executor uses when the trigger fires
// (`TriggerFirer::parse_trigger_sql`) and surface create-time
// *validation* errors (the class SQLite rejects at create time).
//
// We deliberately do NOT make a body-statement parse failure a hard
// gate: VibeSQL's parser does not yet support every construct that
// is valid inside a SQLite trigger body (e.g. `RAISE(ABORT, …)`),
// and SQLite accepts those at create time. Hard-rejecting any
// unparseable body would regress such triggers (which today are
// stored raw and only re-parsed at fire time). So a parse failure
// is only propagated when it is one of the create-time rejection
// classes SQLite also enforces (see [`Parser::is_create_time_rejection`]);
// otherwise the body is preserved as `RawSql` as before.
//
// This is a *validate* pass only — no semantic / name resolution
// (SQLite allows a body referencing a not-yet-created table), so it
// matches SQLite's create-time strictness.
Self::validate_trigger_body(&raw_sql)?;
Ok(vibesql_ast::TriggerAction::RawSql(raw_sql))
}
/// Parse-and-validate each statement of a `BEGIN ... END` trigger body,
/// surfacing the create-time validation errors SQLite enforces.
///
/// Splits the body into statements with
/// [`crate::split_trigger_body_statements`] — the same string-literal- and
/// comment-aware splitter `TriggerFirer::parse_trigger_sql` in
/// `vibesql-executor` uses at fire time, so the two paths cannot drift and
/// neither mishandles a `;` inside a string literal — and parses each
/// statement with [`Parser::parse_sql`]. A parse error is only propagated
/// when it is a create-time rejection class SQLite also enforces (see
/// [`Parser::is_create_time_rejection`]); other parse failures are
/// tolerated so that bodies using constructs VibeSQL cannot yet parse
/// (but SQLite accepts at create time) are preserved as before.
fn validate_trigger_body(raw_sql: &str) -> Result<(), ParseError> {
// Reject any bound parameter / variable anywhere in the body. SQLite
// rejects `CREATE TRIGGER` at create time when a body statement
// references a bound parameter (`?`, `?NNN`, `:name`, `@name`, `$name`,
// `$NNN`) — in INSERT VALUES, UPDATE SET, WHERE, SELECT, GROUP BY,
// ORDER BY, LIMIT, function args, window ORDER BY, etc. — because a
// trigger program is compiled once and has no bind context (triggerE.test
// 1.1.x / 1.2.x). We scan tokens rather than the parsed AST so the check
// is independent of whether VibeSQL can fully parse the body statement
// (some valid SQLite body constructs are tolerated as `RawSql`), and so
// every position is covered uniformly. NEW/OLD references tokenize as
// ordinary identifiers, never as variable tokens, so they are not caught.
if Self::trigger_body_text_references_variable(raw_sql) {
return Err(ParseError {
message: TRIGGER_CANNOT_USE_VARIABLES.to_string(),
});
}
for stmt_sql in crate::split_trigger_body_statements(raw_sql) {
// Re-append the statement terminator the splitter stripped. SQLite
// parses the whole body in one pass, so a statement that ends
// prematurely (e.g. `SELECT * FROM`) reports the *following* `;` as
// the offending token (`near ";": syntax error`, trigger1-2.1 /
// 2.2). Parsing the split statement alone would instead hit EOF and
// report `incomplete input`; restoring the `;` makes the offending
// token — and thus the message — match SQLite. A `;` after a valid
// statement is harmless (parsing stops at the statement boundary).
let stmt_with_terminator = format!("{stmt_sql};");
// Parse each body statement as a trigger-program statement so
// `RAISE()` is admitted (SQLite only permits RAISE() within a
// trigger-program; `parse_sql` rejects it at parse time, but a
// trigger body legitimately contains it).
if let Err(e) = Self::parse_sql_in_trigger_body(&stmt_with_terminator) {
if Self::is_create_time_rejection(&e) {
// Propagate verbatim so the message (e.g.
// `unsupported use of NULLS FIRST`) matches the
// direct-statement form and SQLite.
return Err(e);
}
// Otherwise tolerate: a construct VibeSQL does not yet
// parse. Preserve the prior behavior (stored raw, re-parsed
// at fire time) so we don't reject bodies SQLite accepts.
}
}
Ok(())
}
/// Is this body-statement parse error one that SQLite also rejects at
/// `CREATE TRIGGER` time (rather than a VibeSQL parser gap)?
///
/// Two classes are propagated:
///
/// 1. The `NULLS FIRST/LAST`-in-index-position error class (nulls1.test
/// 3.1.12), whose message is emitted verbatim by
/// `reject_nulls_in_index_position`.
/// 2. Token-level syntax errors (`near "X": syntax error`). A genuine
/// syntax error in a body statement — e.g. `SELECT * FROM;`
/// (trigger1-2.1 / 2.2) — is rejected by SQLite at create time, so we
/// surface it too. This is deliberately distinguished from VibeSQL
/// *parser gaps*, which produce descriptive messages (e.g. "Expected
/// ...") rather than the `near "X": syntax error` form; those are still
/// tolerated so we don't reject bodies SQLite accepts but VibeSQL
/// cannot yet parse.
///
/// Additional create-time rejection classes can be added here as they are
/// identified.
fn is_create_time_rejection(error: &ParseError) -> bool {
error.message.starts_with("unsupported use of NULLS ")
|| (error.message.starts_with("near \"") && error.message.ends_with("\": syntax error"))
}
/// Does the trigger-body SQL text contain a bound-parameter / variable token?
///
/// Lexes the raw body (the `BEGIN ... END` block as a string) and returns
/// `true` if any token is a placeholder or variable: `?` ([`Token::Placeholder`]),
/// `?NNN` / `$NNN` ([`Token::NumberedPlaceholder`]), `:name` / `$name`
/// ([`Token::NamedPlaceholder`]), `@name` ([`Token::UserVariable`]) or
/// `@@name` ([`Token::SessionVariable`]).
///
/// A lexer error is treated as "no variable found": we are only adding a
/// create-time rejection for the variable class here, and an unlexable body
/// is handled (and reported, if appropriate) by the per-statement parse pass
/// below — we must not turn a lex failure into the variable-specific error.
fn trigger_body_text_references_variable(raw_sql: &str) -> bool {
let mut lexer = Lexer::new(raw_sql);
match lexer.tokenize() {
Ok(tokens) => tokens.iter().any(Self::token_is_variable),
Err(_) => false,
}
}
/// Is this token a bound parameter / variable reference (not a NEW/OLD
/// pseudo-column or any other identifier)?
fn token_is_variable(token: &Token) -> bool {
matches!(
token,
Token::Placeholder
| Token::NumberedPlaceholder(_)
| Token::NamedPlaceholder(_)
| Token::UserVariable(_)
| Token::SessionVariable(_)
)
}
/// Does this (already-parsed) expression reference a bound parameter /
/// variable anywhere in its tree? Used for the WHEN clause, which is parsed
/// into an AST before the body is collected as raw SQL. NEW/OLD references
/// are [`vibesql_ast::Expression::PseudoVariable`] and deliberately ignored.
fn expression_references_variable(expr: &vibesql_ast::Expression) -> bool {
let mut found = false;
vibesql_ast::visitor::walk_expression(
&mut VariableExpressionFinder { found: &mut found },
expr,
);
found
}
/// Parse ALTER TRIGGER statement
///
/// Syntax:
/// ALTER TRIGGER trigger_name {ENABLE | DISABLE}
pub(super) fn parse_alter_trigger_statement(
&mut self,
) -> Result<vibesql_ast::AlterTriggerStmt, ParseError> {
// Expect ALTER keyword
self.expect_keyword(Keyword::Alter)?;
// Expect TRIGGER keyword
self.expect_keyword(Keyword::Trigger)?;
// Parse trigger name
let trigger_name = self.parse_identifier()?;
// Parse action: ENABLE or DISABLE
let action = if self.try_consume_keyword(Keyword::Enable) {
vibesql_ast::AlterTriggerAction::Enable
} else if self.try_consume_keyword(Keyword::Disable) {
vibesql_ast::AlterTriggerAction::Disable
} else {
return Err(ParseError {
message: "Expected ENABLE or DISABLE after trigger name".to_string(),
});
};
// Expect semicolon or EOF
if matches!(self.peek(), Token::Semicolon) {
self.advance();
}
Ok(vibesql_ast::AlterTriggerStmt { trigger_name, action })
}
/// Parse DROP TRIGGER statement
///
/// Syntax:
/// DROP TRIGGER [IF EXISTS] trigger_name [CASCADE | RESTRICT]
pub(super) fn parse_drop_trigger_statement(
&mut self,
) -> Result<vibesql_ast::DropTriggerStmt, ParseError> {
// Expect DROP keyword
self.expect_keyword(Keyword::Drop)?;
// Expect TRIGGER keyword
self.expect_keyword(Keyword::Trigger)?;
// Optional IF EXISTS (SQLite / SQL:2008): dropping a missing trigger
// becomes a no-op instead of an error.
let if_exists = if self.peek_keyword(Keyword::If) {
self.advance(); // consume IF
self.expect_keyword(Keyword::Exists)?;
true
} else {
false
};
// Parse trigger name
let trigger_name = self.parse_identifier()?;
// Parse optional CASCADE or RESTRICT
let cascade = if self.try_consume_keyword(Keyword::Cascade) {
true
} else if self.try_consume_keyword(Keyword::Restrict) {
false
} else {
// Default to RESTRICT per SQL:1999
false
};
// Expect semicolon or EOF
if matches!(self.peek(), Token::Semicolon) {
self.advance();
}
Ok(vibesql_ast::DropTriggerStmt { trigger_name, cascade, if_exists })
}
}
/// Expression visitor that records whether any bound-parameter / variable node
/// is present. Used to validate the WHEN clause of a `CREATE TRIGGER`. NEW/OLD
/// references are `Expression::PseudoVariable` and are intentionally not matched.
struct VariableExpressionFinder<'a> {
found: &'a mut bool,
}
impl vibesql_ast::visitor::ExpressionVisitor for VariableExpressionFinder<'_> {
fn pre_visit_expression(
&mut self,
expr: &vibesql_ast::Expression,
) -> vibesql_ast::visitor::VisitResult {
use vibesql_ast::Expression;
if matches!(
expr,
Expression::Placeholder(_)
| Expression::NumberedPlaceholder(_)
| Expression::NamedPlaceholder(_)
| Expression::SessionVariable { .. }
) {
*self.found = true;
return vibesql_ast::visitor::VisitResult::Stop;
}
vibesql_ast::visitor::VisitResult::Continue
}
}