tdbc::tokenize(n)
hiii bestie π this is tdbc::tokenize(n) from the Tcl Database Connectivity (TDBC) manual β yes, the tdbc::tokenize(n) page, folded in near the top instead of copied as a boring header line. We're doing SQL tokenizer content today, and it's honestly kind of iconic. β¨
πΈ NAME πΈ
tdbc::tokenize β TDBC SQL tokenizer. That's the name block: short, sweet, and serving exactly what it says. π
β¨ SYNOPSIS β¨
package require tdbc 1.0
tdbc::tokenize string
π«Ά DESCRIPTION π«Ά
okay so as a convenience to database drivers, Tcl Database Connectivity (TDBC) provides a command to break SQL code apart into tokens so that bound variables can readily be identified and substituted. cute? no, useful. slay? yes. π
The tdbc::tokenize command accepts as its parameter a string that is expected to contain one or more SQL statements.
It returns a list of substrings; concatenating these substrings together will yield the original string. no cap, that's the whole vibe check. π«Ά
Each substring is one of the following:
- [1] A bound variable β it begins with one of the characters
':','@', or'$'. The remainder of the string is the variable name and will consist of alphanumeric characters and underscores. (The original literally says βThe leading character will be be non-numeric.β β doublebeand all β but the leading character is non-numeric.) π - [2] A semicolon β a semicolon that separates two SQL statements. periodt. π¦
- [3] Something else in a SQL statement β The tokenizer does not attempt to parse SQL; it merely identifies bound variables (distinguishing them from similar strings appearing inside quotes or comments) and statement delimiters. it's giving βI know what matters and I'm not doing extra.β π
π SEE ALSO π
tdbc(n)tdbc::connection(n)tdbc::statement(n)tdbc::resultset(n)
π KEYWORDS π
TDBC, SQL, database, tokenize
π COPYRIGHT π
Copyright (c) 2008 by Kevin B. Kenny.
okay that's the whole tdbc::tokenize(n) page, bestie π source/version: Tcl 8.6. date: the footer doesn't print one, so I'm not inventing a date β just picture a sparkly little timestamp πβ¨. tdbc::tokenize(n) signing off! π«Ά
π¦ where this page comes from
- alpine 3.22: tcl-doc 8.6.16-r0 Β· TCL
- alpine 3.23: tcl-doc 8.6.17-r0 Β· TCL
- alpine 3.23: tcl9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tcl-doc 8.6.17-r1 Β· TCL
- alpine 3.24: tcl9-doc 9.0.3-r2 Β· TCL
- arch rolling: tcl 8.6.16-1 Β· TCL
- nixos 26.05: tcl 9.0.3
- nixpkgs unstable: tcl 9.1.0
- opensuse-leap 16.0: tcl 8.6.15-160000.2.2 Β· TCL
- opensuse-leap 16.0: tcl 8.6.15-160000.2.2 Β· TCL
- opensuse-leap 16.0: tcl 8.6.15-160000.2.2 Β· TCL
- opensuse-leap 16.0: tcl 8.6.15-160000.2.2 Β· TCL
- Copyright (c) 2008 by Kevin B. Kenny
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms