@schemat/parser-sql
v0.1.0
Published
SQL DDL parser for Schemat (CREATE TABLE -> IR).
Downloads
98
Readme
@schemat/parser-sql
SQL parser for Schemat: turns SQL DDL
(CREATE TABLE ...) into the canonical Schemat IR.
Install
npm i @schemat/parser-sqlUsage
import { parseSql, sqlParser } from "@schemat/parser-sql";
// Parse a raw DDL string:
const ir = parseSql("CREATE TABLE users (id INT PRIMARY KEY);");
// Or use the SchemaParser interface (detect + parse a project dir / file):
const ir2 = await sqlParser.parse({ projectPath: ".", files: ["schema.sql"] });Both return an IRSchema from
@schemat/core.
License
MIT © Ali Reza Hamid
