2017 © Pedro Peláez
 

library scripd

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

image

samshal/scripd

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

  • Monday, May 30, 2016
  • by Samshal
  • Repository
  • 3 Watchers
  • 10 Stars
  • 32 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 3 Open issues
  • 6 Versions
  • 3 % Grown

The README.md

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., (*1)

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., (*2)

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

It is also very easy to use and integrate into your php based projects, (*4)

License

This software is distributed under the MIT license. Please read LICENSE for information on the software availability and distribution., (*5)

Installation & loading

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

"samshal/scripd": "~1.0"

or, (*7)

composer require samshal/scripd

A Simple Example

JSON DB Structure (structure.json)

{
    ":database":{
        ":crud-action":"create",
        "name":"dbname",

        ":table":[
            {
                ":crud-action":"create",
                "name":"students",
                "columns":[
                    {
                        "name":"id",
                        "data-type":"int",
                        "primary-key":true
                    },
                    {
                        "name":"first_name",
                        "data-type":"varchar(20)",
                        "default":"'samuel'"
                    },
                    {
                        "name":"last_name",
                        "data-type":"varchar(20)"
                    },
                    {
                        "name":"class",
                        "data-type":"varchar(10)"
                    }
                ]
            }
        ]
    }
}

PHP (index.php)

<?php
    require 'vendor/autoload.php';

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

    $jsonDBStructure->parseStructure();

    $sql = $jsonDBStructure->getGeneratedSql();

    echo $sql;

The Versions

30/05 2016

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0

 

database schema parser json generator jsyn

22/05 2016

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1

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

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0

 

database schema parser json generator jsyn

04/05 2016

v1.0.2-alpha

1.0.2.0-alpha

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

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0

 

database schema parser json generator jsyn

30/04 2016

v1.0.x-dev

1.0.9999999.9999999-dev

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

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0

 

database schema parser json generator jsyn

30/04 2016

v1.0.1

1.0.1.0

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

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0

 

database schema parser json generator jsyn

26/04 2016

v1.0.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0

 

database schema parser json generator jsyn