PHP Classes


Recommend this page to a friend!
  Classes of Samuel Adeshina   Scripd   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Scripd
Generate database creation SQL queries from JSON
Author: By
Last change: Update
Date: 7 years ago
Size: 3,061 bytes


Class file image Download

Scripd Build Status Latest Stable Version Total Downloads Latest Unstable Version License Scrutinizer Code Quality StyleCI

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;