Easily transfer database structures as json documents, or via rest apis

v1.0.2-alpha 2016-05-04 20:07 UTC

This package is auto-updated.

Last update: 2020-06-23 14:18:29 UTC


A robust SQL Generator. Parses database structures defined in json based on a custom jsyn file format and generates corresponding sql queries.

Class Features

  • A json like file format to define database structure
  • Support for multiple sql vendors / dialects
  • Compatible with PHP 5.0+
  • Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
  • Much More!

Why you might need it

This project was birthed as a result of the need to give users an opportunity to create their own custom database structure in a PHP Application. I wanted users to be able to modify database structures while there is support for multiple db vendors such as mysql, sqlite and sql server.

This library offers the ability to create database structures in a json-like format and generate sql compatible with several database vendors.

It is also very easy to use and integrate into your php based projects


This software is distributed under the MIT license. Please read LICENSE for information on the software availability and distribution.

Installation & loading

Scripd is available via Composer/Packagist, so just add this line to your composer.json file:

"samshal/scripd": "~1.0"


composer require samshal/scripd

A Simple Example

JSON DB Structure (structure.json)



PHP (index.php)

    require 'vendor/autoload.php';

    $jsonDBStructure = new Samshal\Scripd\JsonDbStructure('./structure.json', 'mysql');


    $sql = $jsonDBStructure->getGeneratedSql();
    echo $sql;