New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

skemabase-js

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skemabase-js

JavaScript SDK for parsing plain-English database schemas into a JSON intermediate representation and generating SQL DDL.

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

skemabase-js

JavaScript SDK for parsing plain-English database schemas into a JSON intermediate representation (IR), generating SQL DDL, and creating Mermaid ER diagrams.

Installation

npm install skemabase-js

Usage

import { parse, generateSQL, generateMermaidDiagram } from 'skemabase-js';

const schema = `
  User has attributes: username unique, email unique, created_at:timestamp default now()
  User has many Post
  Post has attributes: title not null, body, created_at:timestamp default now()
`;

const ir = parse(schema);
const sql = generateSQL(ir, { dialect: 'postgresql' });
console.log(sql);

const diagram = generateMermaidDiagram(ir);
console.log(diagram);

API

  • parse(text: string): Array
  • generateSQL(ir: Array, options?: { dialect: 'postgresql' | 'sqlite' }): string
  • generateMermaidDiagram(ir: Array): string

    Documentation

    See the SkemaBase CLI Reference for command-line usage, and the root README for full project documentation.

    License

    MIT

Keywords

database

FAQs

Package last updated on 02 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts