{"id":14974052,"url":"https://github.com/modeldba/antlr4ts-sql","last_synced_at":"2025-10-27T05:31:34.786Z","repository":{"id":55125288,"uuid":"301026900","full_name":"modeldba/antlr4ts-sql","owner":"modeldba","description":"Pre-built SQL grammars that you can import and “just use”. No configuration necessary.","archived":false,"fork":false,"pushed_at":"2021-03-07T18:30:40.000Z","size":5454,"stargazers_count":31,"open_issues_count":2,"forks_count":10,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-01T02:41:26.262Z","etag":null,"topics":["antlr4","antlr4ts","antlr4ts-sql","lexers","mssql","mysql","parsers","plpgsql","plsql","tsql"],"latest_commit_sha":null,"homepage":"https://modeldba.com/antlr4ts-sql/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/modeldba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-04T02:47:50.000Z","updated_at":"2024-07-15T03:08:24.000Z","dependencies_parsed_at":"2022-08-14T12:40:58.900Z","dependency_job_id":null,"html_url":"https://github.com/modeldba/antlr4ts-sql","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modeldba%2Fantlr4ts-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modeldba%2Fantlr4ts-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modeldba%2Fantlr4ts-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modeldba%2Fantlr4ts-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modeldba","download_url":"https://codeload.github.com/modeldba/antlr4ts-sql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238445840,"owners_count":19473821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antlr4","antlr4ts","antlr4ts-sql","lexers","mssql","mysql","parsers","plpgsql","plsql","tsql"],"created_at":"2024-09-24T13:49:52.952Z","updated_at":"2025-10-27T05:31:33.406Z","avatar_url":"https://github.com/modeldba.png","language":"TypeScript","readme":"# antlr4ts-sql\n\nPre-built SQL grammars that you can import and \"just use\". No configuration necessary.\n\nSupports MySQL, T-SQL (SQL Server), PL/pgSQL (PostgreSQL), PL/SQL (Oracle) dialects.\n\n- Get parsers, lexers and parse-trees with a single method call.\n- Determine if an arbitrary SQL script is syntactically correct.\n- Identify the types of keywords used in the queries.\n\n## Install\n```shell\nnpm install antlr4ts-sql\n```\n\n## [Full documentation can be found here](https://modeldba.com/antlr4ts-sql/docs/)\n\n## Get Started\n\n```typescript\nimport { antlr4tsSQL, SQLDialect } from 'antlr4ts-sql';\n\nconst antlr4tssql = new antlr4tsSQL(SQLDialect.MYSQL);\nconst query = 'SELECT * FROM table1';\nconst parseTree = antlr4tssql.getParseTreeFromSQL(query);\nconsole.log(parseTree);\n\n// Sql_scriptContext {\n//   _parent: undefined,\n//   invokingState: -1,\n//   _start: CommonToken { _line: 1, _charPositionInLine: 0, _channel: 0,\n//                           index: 0, _text: undefined, _type: 614,\n//                           source: { source: [MySQLLexer], stream: [ANTLRInputStream] },\n//                           start: 0, stop: 5\n//   },\n//   children: [\n//     QueryContext {\n//       _parent: [Circular], invokingState: 1212,\n//       _start: [CommonToken], children: [Array], _stop: [CommonToken]\n//     },\n//     TerminalNode { _symbol: [CommonToken], _parent: [Circular] }\n//   ],\n//   _stop: CommonToken { _line: 1, _charPositionInLine: 20, _channel: 0,\n//                         index: 7, _text: undefined, _type: -1,\n//                         source: { source: [MySQLLexer], stream: [ANTLRInputStream] },\n//                         start: 20, stop: 19\n//   }\n// }\n```\n\n## Created By\n\n[![modelDBA logo](https://modeldba.com/antlr4ts-sql/modelDBA128x128.png \"modelDBA\")](https://modeldba.com)\n\nantlr4ts-sql is a project created and maintained by [modelDBA](https://modeldba.com), a database IDE for modern developers. \nmodelDBA lets you visualize SQL as you type and edit tables easily with a no-code table editor.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodeldba%2Fantlr4ts-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodeldba%2Fantlr4ts-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodeldba%2Fantlr4ts-sql/lists"}