diff --git a/.gitignore b/.gitignore index eb9b18d..5883f43 100644 --- a/.gitignore +++ b/.gitignore @@ -24,5 +24,5 @@ temp/ # yarn.lock # pnpm-lock.yaml # or if you use specific test result files -# coverage/ +coverage/ # test-results/ diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..2d9c149 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,23 @@ +# QueryLeaf Development Guide + +## Build & Test Commands +- Full build: `yarn build` +- Typecheck: `yarn typecheck` +- Lint: `yarn lint` (fix: `yarn lint:fix`) +- Format: `yarn format` (check: `yarn format:check`) +- Run all tests: `yarn test` +- Run individual package tests: `yarn test:lib`, `yarn test:cli`, `yarn test:server`, `yarn test:pg-server` +- Run single test: `cd packages/[package] && npx jest -t "test name"` or `npx jest path/to/test.test.ts -t "test name"` +- Integration tests: `yarn test:lib:integration` (requires Docker) +- Documentation: `yarn docs:serve` (dev), `yarn docs:build` (build) + +## Code Style Guidelines +- TypeScript with strict typing; avoid `any` when possible +- Single quotes, trailing commas, 2-space indentation, 100 char line limit +- Prefix unused variables with underscore (e.g., `_unused`) +- Monorepo structure with packages: lib, cli, server, postgres-server +- Descriptive variable/function names in camelCase +- Error handling with proper try/catch blocks and meaningful error messages +- Use async/await for asynchronous code +- Follow existing patterns for similar functionality +- Tests should cover both unit and integration cases \ No newline at end of file diff --git a/README.md b/README.md index 05f88d2..227ba2f 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,11 @@ QueryLeaf is a library that translates SQL queries into MongoDB commands. It par - Array element access (e.g., `items[0].name`) - GROUP BY with aggregation functions (COUNT, SUM, AVG, MIN, MAX) - JOINs between collections +- Multiple interfaces: + - Library for direct integration in your code + - CLI for command-line SQL queries + - Web Server for REST API access + - **PostgreSQL Wire Protocol Server** for connecting with standard PostgreSQL clients ## SQL to MongoDB Translation Examples diff --git a/docs/index.md b/docs/index.md index 6370140..506e374 100644 --- a/docs/index.md +++ b/docs/index.md @@ -157,7 +157,7 @@ db.collection('users').aggregate([
Choose the right option for your workflow