close
The Wayback Machine - https://web.archive.org/web/20201210193122/https://github.com/tarantool/sqlparser
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Tarantool SQL Parser

An SQL parser for LuaJIT. It takes an SQL string as an input and returns an AST. The project is based on Hyrise SQL parser. It uses FFI to communicate with it.

Requirements:

  • gcc 5+ or clang 5+

Installation:

tarantoolctl rocks install sqlparser

Usage:

local parser = require("sqlparser")

local ast = parser.parse("select a from test;")

ast variable now contains:

{
    "parameters": [],
    "errorLine": 0,
    "statements": [
        {
            "fromTable": {
                "type": "table",
                "name": "test"
            },
            "selectList": [
                {
                    "type": "columnRef",
                    "name": "a"
                }
            ],
            "selectDistinct": false,
            "type": "select"
        }
    ],
    "isValid": true
}

And backwards:

local queries = parser.tostring(ast)

queries[1] is:

select "a" from "test";

About

An SQL parser for Tarantool based on Hyrise

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.