Crates.io | sqlite3_tokenizer |
lib.rs | sqlite3_tokenizer |
version | 0.1.0 |
source | src |
created_at | 2015-06-07 01:50:18.694387 |
updated_at | 2015-12-11 23:56:18.321051 |
description | Tokenizes SQL strings as SQLite would |
homepage | https://github.com/PeterReid/sqlite3_tokenizer |
repository | https://github.com/PeterReid/sqlite3_tokenizer |
max_upload_size | |
id | 2329 |
size | 51,178 |
This crate provides Tokenizer, which iterates over tokens in a SQL string as SQLite would.
extern crate sqlite3_tokenizer;
use sqlite3_tokenizer::Tokenizer;
fn main() {
for token in Tokenizer::new("SELECT * FROM t") {
println!("Token of kind {:?} is written {:?}", token.kind, token.text);
}
}
outputs
Token of kind Select is written "SELECT"
Token of kind Space is written " "
Token of kind Star is written "*"
Token of kind Space is written " "
Token of kind From is written "FROM"
Token of kind Space is written " "
Token of kind Id is written "t"