@willbooster/tree-sitter-sql 4.0.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![Test](https://github.com/WillBooster/tree-sitter-sql/actions/workflows/test.yml/badge.svg)](https://github.com/WillBooster/tree-sitter-sql/actions/workflows/test.yml)
6
6
  [![Test rust](https://github.com/WillBooster/tree-sitter-sql/actions/workflows/test-rust.yml/badge.svg)](https://github.com/WillBooster/tree-sitter-sql/actions/workflows/test-rust.yml)
7
7
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
8
- [![wbfy](https://img.shields.io/badge/wbfy-22.1.1-1e90ff.svg)](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
8
+ [![wbfy](https://img.shields.io/badge/wbfy-22.4.0-1e90ff.svg)](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
9
9
  [![crates.io](https://img.shields.io/crates/v/willbooster-tree-sitter-sql.svg)](https://crates.io/crates/willbooster-tree-sitter-sql)
10
10
 
11
11
  SQL grammars for [tree-sitter](https://github.com/tree-sitter/tree-sitter), generated with the
@@ -15,8 +15,8 @@ reject. The supported WillBooster runtime is version 23.0.0 or later in the 23.x
15
15
 
16
16
  ## Dialects
17
17
 
18
- Each dialect has its own grammar and external scanner in `<dialect>/`, built independently on top of the small DSL
19
- helpers in `common/common.mjs`:
18
+ Each dialect has its own grammar and, except MySQL, an external scanner in `<dialect>/`, built independently on top of
19
+ the small DSL helpers in `common/common.mjs`:
20
20
 
21
21
  | Dialect | Directory | Wasm file | Rust constants | Cargo feature |
22
22
  | -------------------------------------------------------------------------------------------- | ------------- | ----------------------------- | ---------------------------------------------- | ------------- |
@@ -25,29 +25,25 @@ helpers in `common/common.mjs`:
25
25
  | [MySQL](https://dev.mysql.com/doc/refman/8.4/en/sql-statements.html) 8.4 | `mysql/` | `tree-sitter-mysql.wasm` | `LANGUAGE_MYSQL`, `MYSQL_NODE_TYPES` | `mysql` |
26
26
  | [Oracle Database](https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/) 23ai | `oracle/` | `tree-sitter-oracle.wasm` | `LANGUAGE_ORACLE`, `ORACLE_NODE_TYPES` | `oracle` |
27
27
 
28
- All four grammars reject what each server's parser grammar and lexer reject (unrecognized tokens, incomplete input,
29
- syntax errors, raw NUL bytes, and client CLI directives) plus single-clause shape checks. Semantic, compile-time, scope,
30
- label, numeric-range, limit, catalog, and cross-clause errors are accepted without `ERROR` nodes:
31
-
32
- - `sqlite` follows SQLite's parser (`src/parse.y`) and tokenizer (`src/tokenize.c`) in its default build, except for
33
- `OVER` as an alias without `AS` before `WINDOW` after a non-call closing parenthesis (such as
34
- `SELECT (1) OVER WINDOW w AS ()`), a NUL character (which ends input for SQLite's C parser), and invalid UTF-8/UTF-16.
35
- - `postgresql` follows PostgreSQL 18's parser (`gram.y`) and lexer (`scan.l`). Client `psql` meta-commands (`\c`, `\i`)
36
- yield syntax errors.
37
- - `mysql` follows MySQL 8.4's parser (`sql_yacc.yy`) and lexer (`sql_lex.cc`) in its default SQL mode, including stored
38
- programs (`CREATE PROCEDURE`, `CREATE FUNCTION`, `CREATE TRIGGER`, `CREATE EVENT`) and executable versioned comments
39
- (`/*! ... */` and `/*!50700 ... */`). Client `mysql` directives (`DELIMITER`, `SOURCE`) yield syntax errors.
40
- - `oracle` follows Oracle Database 23ai's documented SQL and embedded PL/SQL syntax (`CREATE TRIGGER`, `CREATE FUNCTION`,
41
- `CREATE PROCEDURE`, `CREATE PACKAGE`, `CREATE TYPE`, anonymous `DECLARE`/`BEGIN` blocks, and inline `WITH` functions
42
- and procedures). Client SQL*Plus directives (`REM`, `SET`, `CONNECT`, `PROMPT`, `SPOOL`, `@`, standalone `/`) yield
43
- syntax errors.
28
+ `sqlite` follows SQLite's parser (`src/parse.y`) and tokenizer (`src/tokenize.c`) in its default build, except for
29
+ `OVER` as an alias without `AS` before `WINDOW` after a non-call closing parenthesis (such as
30
+ `SELECT (1) OVER WINDOW w AS ()`), a NUL character (which ends input for SQLite's C parser), and invalid UTF-8/UTF-16.
31
+ It rejects what SQLite's parser grammar and tokenizer reject, plus single-clause shape checks; semantic, compile-time,
32
+ scope, label, numeric-range, limit, catalog, and cross-clause errors are accepted without `ERROR` nodes.
33
+
34
+ The other three grammars favor size and speed over completeness: they target the SQL found in application code and
35
+ schema scripts, give structured trees to its common statements, and parse most other statements as a
36
+ `generic_statement` of words, literals, operators, and parenthesized groups up to the next statement terminator.
37
+ Rarely written clauses inside structured statements yield `ERROR` nodes, and some invalid input parses without them.
44
38
 
45
39
  ## Support Scope
46
40
 
47
- This repository maintains only full parsing: valid input yields a correct tree, and invalid input yields `ERROR` or
48
- `MISSING` nodes without crashing, hanging, or taking more than linear time. Incremental parsing is not supported, and no
49
- queries (highlights, locals, injections, tags) are shipped. Node types, field names, and the trees that error recovery
50
- produces may change; such changes are released as new major versions.
41
+ This repository maintains only full parsing, optimized for binary size and parse speed: valid code as found in
42
+ real-world projects yields a correct tree, other valid code yields a correct tree or one with `ERROR` or `MISSING`
43
+ nodes, and any input parses without crashing, hanging, or taking more than linear time. Invalid input may parse without
44
+ `ERROR` or `MISSING` nodes. Incremental parsing is not supported, and no queries (highlights, locals, injections, tags)
45
+ are shipped. Node types, field names, and the trees that error recovery produces may change; such changes are released
46
+ as new major versions.
51
47
 
52
48
  ## Usage
53
49