| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repo is a sandbox, not a product. It was written as a trial-and-error exercise to learn how to build a JQL-style query DSL — lexer, parser, AST visitor, and SQL compilation — before taking on the real implementation. Expect incomplete features and a few dead ends.
The "real thing" will be built as a separate project, informed by what was learned here.
(Entity prop operator value) [And|Or (Entity prop operator value) ...]
Examples:
(User age > 18) (User gender = "F") And (User age > 18)
Flow:
input string → lexer (Chevrotain tokens) → parser (CST) → visitor (normalized IR) → query builder (SQL string)
npm install npm test # Jasmine suite npm run dev # Nodemon on src/index.ts npm run tsc # Type-check + build to main/
Configure .env:
HOST=localhost DB_NAME=my_db USER_NAME=my_user PASSWORD=*** DB_TYPE=mysql OUTPUT_PATH=./src/lib/ORM/
Then:
npm run generate-types
src/
├── index.ts
└── lib/
├── lexer/ # Chevrotain tokens
├── parser/ # CST parser rules
├── visitor/ # CST → IR
└── ORM/
├── db-connector/ # TypeORM DataSource factory
├── query-builder/ # IR → SQL
├── entities/ # Generated entity classes
└── scripts/ # generate-types.js
Archived as a reference. The production implementation lives elsewhere (or will). Please don't depend on this package.
| Back | FazBrowse Home | New Git URL |