tree-sitter-sql


Nametree-sitter-sql JSON
Version 0.3.5 PyPI version JSON
download
home_pageNone
SummarySql grammar for tree-sitter
upload_time2024-08-09 20:39:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords incremental parsing tree-sitter sql
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tree-sitter-sql

[![Build/test](https://github.com/derekstride/tree-sitter-sql/actions/workflows/ci.yml/badge.svg)](https://github.com/derekstride/tree-sitter-sql/actions/workflows/ci.yml)
[![GitHub Pages](https://github.com/DerekStride/tree-sitter-sql/actions/workflows/gh-pages.yml/badge.svg)](https://github.com/DerekStride/tree-sitter-sql/actions/workflows/gh-pages.yml)
[![npm package version](https://img.shields.io/npm/v/%40derekstride/tree-sitter-sql?logo=npm&color=brightgreen)](https://www.npmjs.com/package/@derekstride/tree-sitter-sql)


A general/permissive SQL grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).

## Installation

**We don't commit the generated parser files to the `main` branch.** Instead, you can find them on the
[gh-pages](https://github.com/DerekStride/tree-sitter-sql/tree/gh-pages) branch. We're open to feedback & encourage you
to [open an issue](https://github.com/DerekStride/tree-sitter-sql/issues/new) to discuss any problems.

They are also hosted on the [GitHub pages site](https://derek.stride.host/tree-sitter-sql/) and available for download
here:
[github://derekstride/tree-sitter-sql/gh-pages.tar.gz](https://github.com/DerekStride/tree-sitter-sql/archive/refs/heads/gh-pages.tar.gz).

*Plugin maintainers ensure to specify the `HEAD` (or a specific revision) of the `gh-pages` branch when integrating
with this project.*

### Step 1: Download the parser files

**Using `git`**
```bash
git clone https://github.com/DerekStride/tree-sitter-sql.git
cd tree-sitter-sql
git checkout gh-pages
```

**Using `curl`**
```bash
curl -LO https://github.com/DerekStride/tree-sitter-sql/archive/refs/heads/gh-pages.tar.gz
tar -xzf gh-pages.tar.gz
cd tree-sitter-sql-gh-pages
```

### Step 2: Compile the Parser

Tree-sitter parsers need to be compiled as a shared-object / dynamic-library, you can enable this by passing the
`-shared` & `-fPIC` flags to your compiler.

```bash
cc -shared -fPIC -I./src src/parser.c src/scanner.c -o sql.so
```

### Using [Cargo](https://crates.io/crates/tree-sitter-sequel)

```bash
cargo add tree-sitter-sequel
```

### Using [NPM](https://www.npmjs.com/package/@derekstride/tree-sitter-sql)

```bash
npm i @derekstride/tree-sitter-sql
```

## Development

See [CONTRIBUTING.md](CONTRIBUTING.md) for documentation on how to set up the project for development.

## Features

For a complete list of features see the the [tests](test/corpus)

## References

* [Wikipedia#SQL_syntax](https://en.wikipedia.org/wiki/SQL_syntax) - I consulted wikipedia for naming conventions,
  though I may not have been strict early on in the prototyping.
* [Phoenix Language Reference](https://forcedotcom.github.io/phoenix/index.html) - A reference diagram.
* [SQLite's railroad diagram for expr](https://www.sqlite.org/lang_expr.html) - Another reference diagram.
* [Postgresql syntax documentation](https://www.postgresql.org/docs/current/sql-commands.html)
* [Mariadb syntax documentation](https://mariadb.com/kb/en/sql-statements-structure/)

### Other projects

* https://github.com/m-novikov/tree-sitter-sql
* https://github.com/tjdevries/tree-sitter-sql
* https://github.com/dhcmrlchtdj/tree-sitter-sqlite

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tree-sitter-sql",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "incremental, parsing, tree-sitter, sql",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/33/cc/5a2844d8c7d264022ff38b2cbdb904d5f4cc39b3989d29d7e75bc6a7b680/tree-sitter-sql-0.3.5.tar.gz",
    "platform": null,
    "description": "# tree-sitter-sql\n\n[![Build/test](https://github.com/derekstride/tree-sitter-sql/actions/workflows/ci.yml/badge.svg)](https://github.com/derekstride/tree-sitter-sql/actions/workflows/ci.yml)\n[![GitHub Pages](https://github.com/DerekStride/tree-sitter-sql/actions/workflows/gh-pages.yml/badge.svg)](https://github.com/DerekStride/tree-sitter-sql/actions/workflows/gh-pages.yml)\n[![npm package version](https://img.shields.io/npm/v/%40derekstride/tree-sitter-sql?logo=npm&color=brightgreen)](https://www.npmjs.com/package/@derekstride/tree-sitter-sql)\n\n\nA general/permissive SQL grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).\n\n## Installation\n\n**We don't commit the generated parser files to the `main` branch.** Instead, you can find them on the\n[gh-pages](https://github.com/DerekStride/tree-sitter-sql/tree/gh-pages) branch. We're open to feedback & encourage you\nto [open an issue](https://github.com/DerekStride/tree-sitter-sql/issues/new) to discuss any problems.\n\nThey are also hosted on the [GitHub pages site](https://derek.stride.host/tree-sitter-sql/) and available for download\nhere:\n[github://derekstride/tree-sitter-sql/gh-pages.tar.gz](https://github.com/DerekStride/tree-sitter-sql/archive/refs/heads/gh-pages.tar.gz).\n\n*Plugin maintainers ensure to specify the `HEAD` (or a specific revision) of the `gh-pages` branch when integrating\nwith this project.*\n\n### Step 1: Download the parser files\n\n**Using `git`**\n```bash\ngit clone https://github.com/DerekStride/tree-sitter-sql.git\ncd tree-sitter-sql\ngit checkout gh-pages\n```\n\n**Using `curl`**\n```bash\ncurl -LO https://github.com/DerekStride/tree-sitter-sql/archive/refs/heads/gh-pages.tar.gz\ntar -xzf gh-pages.tar.gz\ncd tree-sitter-sql-gh-pages\n```\n\n### Step 2: Compile the Parser\n\nTree-sitter parsers need to be compiled as a shared-object / dynamic-library, you can enable this by passing the\n`-shared` & `-fPIC` flags to your compiler.\n\n```bash\ncc -shared -fPIC -I./src src/parser.c src/scanner.c -o sql.so\n```\n\n### Using [Cargo](https://crates.io/crates/tree-sitter-sequel)\n\n```bash\ncargo add tree-sitter-sequel\n```\n\n### Using [NPM](https://www.npmjs.com/package/@derekstride/tree-sitter-sql)\n\n```bash\nnpm i @derekstride/tree-sitter-sql\n```\n\n## Development\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for documentation on how to set up the project for development.\n\n## Features\n\nFor a complete list of features see the the [tests](test/corpus)\n\n## References\n\n* [Wikipedia#SQL_syntax](https://en.wikipedia.org/wiki/SQL_syntax) - I consulted wikipedia for naming conventions,\n  though I may not have been strict early on in the prototyping.\n* [Phoenix Language Reference](https://forcedotcom.github.io/phoenix/index.html) - A reference diagram.\n* [SQLite's railroad diagram for expr](https://www.sqlite.org/lang_expr.html) - Another reference diagram.\n* [Postgresql syntax documentation](https://www.postgresql.org/docs/current/sql-commands.html)\n* [Mariadb syntax documentation](https://mariadb.com/kb/en/sql-statements-structure/)\n\n### Other projects\n\n* https://github.com/m-novikov/tree-sitter-sql\n* https://github.com/tjdevries/tree-sitter-sql\n* https://github.com/dhcmrlchtdj/tree-sitter-sqlite\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Sql grammar for tree-sitter",
    "version": "0.3.5",
    "project_urls": {
        "Homepage": "https://github.com/tree-sitter/tree-sitter-sql"
    },
    "split_keywords": [
        "incremental",
        " parsing",
        " tree-sitter",
        " sql"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "019562270e17caced7280fc149a50323542e8dfd4d0e945aa82332c08653e9aa",
                "md5": "28ec2109f976b6e49ab2332ed8eb0663",
                "sha256": "4a00aed92d96e4665715dc9b14d5e5619514fda2f8c20c0e39993c335453dc1b"
            },
            "downloads": -1,
            "filename": "tree_sitter_sql-0.3.5-cp38-abi3-macosx_10_9_x86_64.whl",
            "has_sig": false,
            "md5_digest": "28ec2109f976b6e49ab2332ed8eb0663",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 278860,
            "upload_time": "2024-08-09T20:39:25",
            "upload_time_iso_8601": "2024-08-09T20:39:25.203124Z",
            "url": "https://files.pythonhosted.org/packages/01/95/62270e17caced7280fc149a50323542e8dfd4d0e945aa82332c08653e9aa/tree_sitter_sql-0.3.5-cp38-abi3-macosx_10_9_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c50e3e095983d6cfe7a874d14a595068050cd38b1c0701b04233e2161f93c0e2",
                "md5": "24caecddde812c892db99ecee77a084f",
                "sha256": "dc2a770c7508fddb2a6e8daec6c0db5543386b30f625f89a752fb2b534187367"
            },
            "downloads": -1,
            "filename": "tree_sitter_sql-0.3.5-cp38-abi3-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "24caecddde812c892db99ecee77a084f",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 293324,
            "upload_time": "2024-08-09T20:39:26",
            "upload_time_iso_8601": "2024-08-09T20:39:26.880091Z",
            "url": "https://files.pythonhosted.org/packages/c5/0e/3e095983d6cfe7a874d14a595068050cd38b1c0701b04233e2161f93c0e2/tree_sitter_sql-0.3.5-cp38-abi3-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b42c78dc1521d0fa59a79954eb7591a3ed081dc1ebc5888a4ce6be00aaac5003",
                "md5": "885655876cbdcd82be57fb28539d3927",
                "sha256": "628e78455ef35b64c0686f399684cd620aeed8ae4b965f38a98cf4bfb7fdf47c"
            },
            "downloads": -1,
            "filename": "tree_sitter_sql-0.3.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "has_sig": false,
            "md5_digest": "885655876cbdcd82be57fb28539d3927",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 333894,
            "upload_time": "2024-08-09T20:39:28",
            "upload_time_iso_8601": "2024-08-09T20:39:28.237605Z",
            "url": "https://files.pythonhosted.org/packages/b4/2c/78dc1521d0fa59a79954eb7591a3ed081dc1ebc5888a4ce6be00aaac5003/tree_sitter_sql-0.3.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4d47644c94046fa0de4ff69ee3a5aa8d0645c702714287bb5f9f9e1ad85e4d57",
                "md5": "4be3f4d28d333ddd67ef5ef69bae44cd",
                "sha256": "5934cf1b8d235ca94c84fa39b0f85c1718c2ee2e059a9d41b357c837beb4802f"
            },
            "downloads": -1,
            "filename": "tree_sitter_sql-0.3.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "4be3f4d28d333ddd67ef5ef69bae44cd",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 331878,
            "upload_time": "2024-08-09T20:39:29",
            "upload_time_iso_8601": "2024-08-09T20:39:29.816779Z",
            "url": "https://files.pythonhosted.org/packages/4d/47/644c94046fa0de4ff69ee3a5aa8d0645c702714287bb5f9f9e1ad85e4d57/tree_sitter_sql-0.3.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1d8d0dca009fdafa7d49649a50298a8ac1ea39284d65ff25cb7b06fdf61f6229",
                "md5": "9364aaaf8cf2e647cc98a76edb4e4939",
                "sha256": "d19e13fca1efc6f8e029ca0b28cd447f98be40e5179e21eab76c07963f8a70cd"
            },
            "downloads": -1,
            "filename": "tree_sitter_sql-0.3.5-cp38-abi3-musllinux_1_2_aarch64.whl",
            "has_sig": false,
            "md5_digest": "9364aaaf8cf2e647cc98a76edb4e4939",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 335531,
            "upload_time": "2024-08-09T20:39:31",
            "upload_time_iso_8601": "2024-08-09T20:39:31.435610Z",
            "url": "https://files.pythonhosted.org/packages/1d/8d/0dca009fdafa7d49649a50298a8ac1ea39284d65ff25cb7b06fdf61f6229/tree_sitter_sql-0.3.5-cp38-abi3-musllinux_1_2_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "416a265d91aec8aa8761b2745643ef728bc8aeef6bb53d68feb84a926a5ac703",
                "md5": "5b30686aa7033fd8c3b8accedfcdb80c",
                "sha256": "2be67259947c767d697867cae4b1e978a6f1a4222ea787f3f8abf86b3aca02d9"
            },
            "downloads": -1,
            "filename": "tree_sitter_sql-0.3.5-cp38-abi3-musllinux_1_2_x86_64.whl",
            "has_sig": false,
            "md5_digest": "5b30686aa7033fd8c3b8accedfcdb80c",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 333315,
            "upload_time": "2024-08-09T20:39:32",
            "upload_time_iso_8601": "2024-08-09T20:39:32.833218Z",
            "url": "https://files.pythonhosted.org/packages/41/6a/265d91aec8aa8761b2745643ef728bc8aeef6bb53d68feb84a926a5ac703/tree_sitter_sql-0.3.5-cp38-abi3-musllinux_1_2_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8edeff5139b8ea546c6e4c8c185ee09ffc055183d35def00251566b8018aaed7",
                "md5": "bfc869c6afc3b63b1c9a292826648baa",
                "sha256": "23404d1eabdd7aac44c9202b506997bb22151c96e1adccc28fe83ae3887711f8"
            },
            "downloads": -1,
            "filename": "tree_sitter_sql-0.3.5-cp38-abi3-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "bfc869c6afc3b63b1c9a292826648baa",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 301265,
            "upload_time": "2024-08-09T20:39:34",
            "upload_time_iso_8601": "2024-08-09T20:39:34.175477Z",
            "url": "https://files.pythonhosted.org/packages/8e/de/ff5139b8ea546c6e4c8c185ee09ffc055183d35def00251566b8018aaed7/tree_sitter_sql-0.3.5-cp38-abi3-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "33cc5a2844d8c7d264022ff38b2cbdb904d5f4cc39b3989d29d7e75bc6a7b680",
                "md5": "f737627dd90923d64319c2d4459b5d05",
                "sha256": "97578d0495171839c5659ff6b257c667d48b81d1aa547017b196b5551f440106"
            },
            "downloads": -1,
            "filename": "tree-sitter-sql-0.3.5.tar.gz",
            "has_sig": false,
            "md5_digest": "f737627dd90923d64319c2d4459b5d05",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5718,
            "upload_time": "2024-08-09T20:39:35",
            "upload_time_iso_8601": "2024-08-09T20:39:35.441014Z",
            "url": "https://files.pythonhosted.org/packages/33/cc/5a2844d8c7d264022ff38b2cbdb904d5f4cc39b3989d29d7e75bc6a7b680/tree-sitter-sql-0.3.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-09 20:39:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tree-sitter",
    "github_project": "tree-sitter-sql",
    "github_not_found": true,
    "lcname": "tree-sitter-sql"
}
        
Elapsed time: 3.96887s