Generated Computers
Locals는 Apple Silicon 엔진으로 로컬 LLM을 최대 3배 빠르게 실행하는 Generated Computers 제품
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기SQL grammar for tree-sitter
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗SQL grammars for tree-sitter: a strict ANSI base and 22 dialects built on top of it. Each dialect is its own parser, so Postgres code is parsed as Postgres and T-SQL as T-SQL.
Forked from DerekStride/tree-sitter-sql, which mixes several dialects into one permissive grammar.
pip install tree-sitter-sql-polyglot
npm install @relativelyunknown/tree-sitter-sql-polyglot
cargo add tree-sitter-sql-polyglot --features postgres # or --features full for all 22
go get github.com/relativelyunknown/tree-sitter-sql-polyglot/bindings/go/postgres
Swift (SwiftPM) and C (CMake) are supported too. See the usage docs.
from tree_sitter import Language, Parser
import tree_sitter_sql
parser = Parser(Language(tree_sitter_sql.language_postgres()))
tree = parser.parse(b"SELECT id FROM users WHERE name ILIKE 'a%'")
import Parser from "tree-sitter";
import { postgres } from "@relativelyunknown/tree-sitter-sql-polyglot";
const parser = new Parser();
parser.setLanguage(postgres);
const tree = parser.parse("SELECT id FROM users WHERE name ILIKE 'a%'");
Only the dialects you use get compiled or loaded. Each one also ships its own highlights query
(HIGHLIGHTS_QUERY_POSTGRES in Python and Rust, postgres.HIGHLIGHTS_QUERY in Node).
| Dialect | Extends | Notable syntax |
|---|---|---|
| base | ANSI SQL: GROUPING SETS, OFFSET ... FETCH, WITHIN GROUP, GRANT/REVOKE | |
| postgres | base | COPY, VACUUM, :: casts, PARTITION OF, row-level security policies |
| cockroachdb | postgres | AS OF SYSTEM TIME, UPSERT, BACKUP/RESTORE, changefeeds |
| mysql | base | ENGINE=, index hints, SHOW, LIMIT offset, count, @@ variables |
| mariadb | mysql | system-versioned tables, RETURNING, INVISIBLE columns |
| sqlite | base | INSERT OR REPLACE, AUTOINCREMENT, INDEXED BY |
| oracle | base | PL/SQL blocks and packages, CONNECT BY, BULK COLLECT |
| db2 | base | SQL PL, modules, audit policies, federated objects |
| tsql | base | T-SQL scripting, CROSS APPLY, query hints, #temp tables |
| hana | base | column/row tables, UPSERT ... WITH PRIMARY KEY, SQLScript |
| teradata | base | SEL/DEL, PRIMARY INDEX, RANGE_N, COLLECT STATISTICS |
| bigquery | base | STRUCT<...>/ARRAY<...>, UNNEST, QUALIFY |
| spanner | bigquery | INTERLEAVE IN PARENT, change streams, row deletion policies |
| snowflake | base | scripting, LATERAL FLATTEN, time travel, @stage |
| redshift | base | DISTKEY/, external schemas, / |
A child dialect only adds what its engine adds; it gets the rest from its parent. How much of each engine's syntax is covered, checked against SQLGlot, ANTLR, pglast and sqlfluff, is on the coverage page.
You need Node and the tree-sitter CLI (npm install -g tree-sitter-cli).
npm install # unpacks the committed parsers and builds the Node addons
npm run generate # regenerate the base parser after editing grammar/
npm run generate -- postgres # or a single dialect
npm run generate:all # or everything
npm run test:corpus # base corpus tests
(cd postgres && npx tree-sitter test) # a dialect's corpus tests
A base grammar change affects every dialect, so regenerate and test all of them. Generation is
cached by file hash; npm run generate:force skips the cache.
CONTRIBUTING.md covers the workflow and AGENTS.md the grammar layout.
MIT. The git history from upstream is kept, so upstream authors show up in the contributors list;
CODEOWNERS lists who maintains this fork. LICENSE carries both copyright
notices.
SORTKEYCOPYUNLOAD| duckdb | base | FROM-first SELECT, EXCLUDE/REPLACE, lambdas, ASOF JOIN |
| clickhouse | base | ENGINE = MergeTree, PREWHERE, FINAL, ARRAY JOIN, LIMIT BY |
| trino | base | MATCH_RECOGNIZE, PREPARE/EXECUTE, lambdas, ROW types |
| athena | trino | UNLOAD ... TO 's3://...', MSCK REPAIR TABLE |
| flink | base | connector DDL, WATERMARK FOR, window TVFs, temporal joins |
| hive | base | LATERAL VIEW, STORED AS, multi-table INSERT |
| spark | hive | PIVOT, QUALIFY, scripting, Iceberg, VARIANT |
| databricks | spark | Delta OPTIMIZE/VACUUM, Unity Catalog, COPY INTO |