Parse GraphQL type definitions into SQLite DDL statements, including CREATE TABLE with auto-generated id, created_at, updated_at, triggers, and support for directives (default, unique, index, primary, autoIncrement) and ORM relations (belongsTo, hasAndBelongsToMany). Current version 2.0.4. Lightweight, no external dependencies beyond GraphQL.js. Distinct from general ORMs by translating GraphQL schemas directly to SQL for SQLite.
npm install graphql-to-sqlite-ddlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: define a GraphQL schema, parse it, and output SQLite DDL string.
Ensure you pass a schema object created with buildSchema().
If you don't want these columns, you may need to modify the output manually or use a different tool.
Use the documented directive syntax with foreignKey to specify custom column names.
If you want true autoincrement, add the @autoIncrement directive to the id field or manually alter the table.
Pin to exact version if using in production.
Use buildSchema(sdlString) to create a schema object before passing to parse().
Run: npm install graphql
Use: import { parse } from 'graphql-to-sqlite-ddl'