Code Monkey home page Code Monkey logo

db-generator's Introduction

DB Generator

This is just simple way to generate/create a mysql database (like migration at Laravel)

Installation

git clone https://github.com/haloriyan/db-generator.git

How to use?

  • First, star this repo, after that clone it
  • After cloning, open the db.json file
  • You can create or change database and table according to your needs in this file
  • Run create.php with your browser

Documentation

Database name

{
  "namaDb": "myDb"
  ...
}

I think there's no difficulty here

Setting up the tables

{
  ...
  "tabel": {
    "table1": [
      "id int(11)",
      "name varchar(20)",
      "dummy varchar(10) null"
    ],
    "table2":
    "table3":
    "etc"
  }
}

id, name, and dummy are names of your structures table. int and varchar are datatype of the structure. And null is optional. If you dont type it, that mean set to default which mean not null.

Giving extra attribute

You can give extra attribute like primary key or unique key to your table structure like this

{
  "tabel": {
    "table1" : [ ... ]
  },
  "atribut": {
    "primary key": [
      "table1.id",
      "table2.username"
      "table3.etc"
    ],
    "unique key": [
      "table1.name",
      "table2.email",
      "table3.etc"
    ]
  }
}

I think you already understand with this. table1.id in primary key is structure where is set up to be primary. So also with the unique key. table1 is name of your table, and id is structur name of your table.

db-generator's People

Contributors

haloriyan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.