A React-based Entity Relationship Diagram (ERD) generator for SQLite databases. Transform your SQL schemas or database files into interactive, visual diagrams.
Visualizing complex database schemas can be challenging. sqlite-erd helps developers:
- Understand existing database structures quickly.
- Document schemas for team collaboration.
- Debug relationship issues by visualizing foreign key constraints.
- Explore SQLite database files without needing a full-blown database manager.
sqlite-erd is designed with privacy in mind:
- Local First: All SQL parsing and diagram generation happen directly in your browser.
- Privacy Focused: Your database schemas and files are never uploaded to any server.
- No Data Leaves the Browser: All processing is done client-side, ensuring your sensitive data stays on your machine.
You can use the built-in web application to visualize your schemas:
- Upload a
.sqlfile withCREATE TABLEstatements or a SQLite database file (e.g.,.db,.sqlite,.sqlite3,.s3db,.sl3). - Or paste your SQL
CREATE TABLEstatements directly into the editor.
You can also integrate the SQLiteERD component into your own React projects.
npm install sqlite-erdimport { SQLiteERD } from 'sqlite-erd';
import 'sqlite-erd/sqlite-erd.css';
const mySqlSchema = `
CREATE TABLE users (
id INTEGER PRIMARY KEY,
username TEXT NOT NULL
);
`;
const App = () => {
return (
<SQLiteERD sqlSchema={mySqlSchema} showSidebar />
);
};This is a monorepo managed by Turbo:
apps/web: A demo web application built with Vite and React.packages/sqlite-erd: The core React component library.
- Clone the repository.
- Install dependencies:
npm install
- Run the development environment:
turbo run dev
MIT
