Skip to content

Latest commit

 

History

History
75 lines (52 loc) · 1.78 KB

File metadata and controls

75 lines (52 loc) · 1.78 KB

Development Guide

This project is a Yarn/Lerna workspace for PostgreSQL parser and deparser functionality. Follow these steps to get started with development.

Prerequisites

  • Node.js (v14 or higher recommended)
  • Yarn package manager

Initial Setup

  1. Install dependencies:
yarn
  1. Build all packages:
yarn build

Running Tests

The project uses Jest for testing. Each package has its own test suite.

Running Tests for a Specific Package

To run tests for a specific package, navigate to that package's directory and use the test:watch command:

cd packages/deparser
yarn test:watch

you can also run yarn test if you don't need to watch.

This will start Jest in watch mode, which will automatically re-run tests when files change.

Available Packages

  • packages/deparser: SQL deparser implementation
  • packages/parser: SQL parser implementation
  • packages/types: TypeScript type definitions
  • packages/utils: Utility functions

Project Structure

packages/
  ├── deparser/     # SQL deparser implementation
  ├── parser/       # SQL parser implementation
  ├── types/        # TypeScript type definitions
  └── utils/        # Utility functions

Development Workflow

  1. Make changes to the code
  2. Run tests in watch mode for the affected package
  3. Ensure all tests pass
  4. Commit your changes

Common Commands

  • yarn build: Build all packages
  • yarn test: Run all tests
  • yarn test:watch: Run tests in watch mode
  • yarn lint: Run linter
  • yarn clean: Clean build artifacts

Notes

  • The project uses Lerna for managing multiple packages in a monorepo
  • Each package can be developed and tested independently
  • Changes to shared packages (types, utils) may require rebuilding dependent packages