Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

Generate “create table” script (which can be execute later) using json string

General Tech Bugs & Fixes
Max. 2000 characters
Replies

usr_profile.png
Vanshika Bhatt

User

( 7 months ago )

 

I have create a DDL using the json string, which will help DBA to create table.. If someone can suggest any existing library which does this or any shorter code which will help to create the DDL..

Below is my json which i have used to create "create table" script.

{
  "person_address" : {
    "type" : "object",
    "required" : [ "person_id", "address_type" ],
    "primaryKey" : [ "person_id, address_type" ],
    "foreignKeys" : [ {
      "fields" : "person_id",
      "reference" : {
        "fields" : "person_id",
        "resource" : "person"
      }
    } ],
    "properties" : {
      "end_date" : {
        "type" : "date",
        "description" : null
      },
      "zip" : {
        "type" : "string",
        "description" : "The postal code of the address",
        "minLength" : 1,
        "maxLength" : 10
      },
      "country" : {
        "type" : "string",
        "description" : "The country of the address",
        "minLength" : 1,
        "maxLength" : 10
      },
      "line4" : {
        "type" : "string",
        "description" : "The line 4 of the address",
        "minLength" : 1,
        "maxLength" : 20
      },
      "address_type" : {
        "type" : "string",
        "description" : "The type of address for the person",
        "minLength" : 1,
        "maxLength" : 2147483647
      },
      "city" : {
        "type" : "string",
        "description" : "The city of the address",
        "minLength" : 1,
        "maxLength" : 10
      },
      "status_type" : {
        "type" : "string",
        "description" : null,
        "minLength" : 1,
        "maxLength" : 100
      },
      "language_code" : {
        "type" : "string",
        "description" : null,
        "minLength" : 1,
        "maxLength" : 100
      },
      "effective_date" : {
        "type" : "date",
        "description" : null
      },
      "state" : {
        "type" : "string",
        "description" : "The state of the address",
        "minLength" : 1,
        "maxLength" : 10
      },
      "line3" : {
        "type" : "string",
        "description" : "The line 3 of the address",
        
			
        

what's your interest