Skip to content

its-elad/sql-lineage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL Lineage Monorepo

This monorepo is managed with Turborepo and contains tools for SQL lineage extraction, UI components, linting, and TypeScript configuration. It is organized into apps and packages, all written in TypeScript.

Monorepo Structure

Apps

App Description
@sql-lineage/demo Vite-based demo app for testing and showcasing SQL lineage features

Packages

Package Description
@sql-lineage/core TypeScript library for extracting column and table lineage from Trino SQL queries (ANTLR4-based) — see package README
@sql-lineage/eslint-config Shared ESLint configuration (includes Next.js and Prettier configs)
@sql-lineage/typescript-config Shared TypeScript configuration files

What the lineage library does

Supported dialect: Trino SQL, parsed via the official Trino ANTLR4 grammar from Trino's source code.

@sql-lineage/core statically analyses a Trino SQL statement and answers two questions:

  • Which physical tables does this query read from? (getUpstreamTables) — returns a sorted, de-duplicated list of real table names, excluding CTEs and derived tables.
  • Which columns from each table are actually used? (getColumnLineage) — tracks every column reference across the full query (SELECT, WHERE, JOIN, GROUP BY, HAVING, ORDER BY, window functions) and maps each one back to its source table.

See the full API and logic documentation for details.

Quick Start

Clone the repo and install dependencies:

git clone <repo-url>
cd sql-lineage
npm install

Build

To build all apps and packages:

npx turbo build

To build a specific package/app:

npx turbo build --filter=@sql-lineage/core
npx turbo build --filter=demo

Develop

To start development mode for all apps/packages:

npx turbo dev

To develop a specific app:

npx turbo dev --filter=demo

Test

To run tests for the lineage package:

npm -w @sql-lineage/core run test

Remote Caching

Turborepo supports Remote Caching via Vercel. To enable, authenticate and link your repo:

npx turbo login
npx turbo link

Useful Links


For package-specific details, see individual README files in each package/app.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages