Skip to content

Commit 9c0e73b

Browse files
committed
cgosqlite: support named parameters with $ prefix
This allows using the "$VVV" syntax for named parameters in SQLite, as described in https://sqlite.org/c3ref/bind_blob.html Updates tailscale/corp#35883 Signed-off-by: Andrew Dunham <andrew@tailscale.com>
1 parent e28eaf5 commit 9c0e73b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cgosqlite/cgosqlite.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ func (stmt *Stmt) BindParameterIndexSearch(name string) int {
357357
if i := stmt.BindParameterIndex("@" + name); i > 0 {
358358
return i
359359
}
360+
if i := stmt.BindParameterIndex("$" + name); i > 0 {
361+
return i
362+
}
360363
return stmt.BindParameterIndex("?" + name)
361364
}
362365

0 commit comments

Comments
 (0)