Docs.rs
  • sqlparser-queryscript-0.30.0
    • sqlparser-queryscript 0.30.0
    • Docs.rs crate page
    • Apache-2.0
    • Links
    • Homepage
    • Repository
    • crates.io
    • Source
    • Owners
    • ankrgyl
    • Dependencies
      • bigdecimal ^0.3 normal
      • log ^0.4 normal
      • serde ^1.0 normal
      • serde_json ^1.0 normal
      • sqlparser_derive ^0.1.1 normal
      • matches ^0.1 dev
      • pretty_assertions ^1 dev
      • simple_logger ^4.0 dev
    • Versions
    • 20.75% of the crate is documented
  • Go to latest version
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation
logo

Crate sqlparser

logo

Crate sqlparser

  • Version 0.30.0
  • All Items
  • Modules

Crates

  • sqlparser
?
Change settings

Crate sqlparser

source ·
Expand description

SQL Parser for Rust

This crate provides an ANSI:SQL 2011 lexer and parser that can parse SQL into an Abstract Syntax Tree (AST). See the sqlparser crates.io page for more information.

See Parser::parse_sql and Parser::new for the Parsing API and the ast crate for the AST structure.

Example:

use sqlparser::dialect::GenericDialect;
use sqlparser::parser::Parser;

let dialect = GenericDialect {}; // or AnsiDialect

let sql = "SELECT a, b, 123, myfunc(b) \
           FROM table_1 \
           WHERE a > b AND b < 100 \
           ORDER BY a DESC, b";

let ast = Parser::parse_sql(&dialect, sql).unwrap();

println!("AST: {:?}", ast);

Modules

ast
SQL Abstract Syntax Tree (AST) types
dialect
keywords
This module defines
location
parser
SQL Parser
tokenizer
SQL Tokenizer

Results

sqlparser::ast::VisitorMut
A visitor that can be used to mutate an AST tree.
sqlparser::ast::VisitMut
A type that can be visited by a VisitorMut. See VisitorMut …
sqlparser::ast::Visitor
A visitor that can be used to walk an AST tree.
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.