Insert

After creating table, we will insert data to those tables:

-------insert into candidates table-------
INSERT INTO Candidates (FirstName, LastName, Gender, Birthdate, Location) 
VALUES ('John','Johnson',1,'1999-02-05','Ohio'), ('Dinana','White',0,'1995-11-12','New York');

-------insert into jobs table-------    
INSERT INTO Jobs(Title, Description, Salary, Category, PostDate, ExpireDate, EmployerId) 
VALUES  ('Business Analyst','Analysis Business Logic.....','800 – 1500 USD','IT-Software','2017-09-01','2017-09-30', 1),
        ('Premium Banking Assistant','Maintain excellent customer relations.....','Negotiate','Banking','2017-09-11','2017-10-30', 1)

dbAPI for CouchDB usage:

var dbAPI = require('./dbAPI-server').dbAPI;
                         
dbAPI(input, function (output) {
    //Handle output
});

with the input:

input = {
    "metadata": {
        "dbinfo": {
            "DBMS": "couchdb",
            "cFile": "../dbAPI-server/config/dbinfo.couchdb.json"
        }
    },
    "data": {
        "format": "text",
        "szSQL": "INSERT INTO Candidates (FirstName, LastName, Gender, Birthdate, Location) VALUES ('John','Johnson',1,'1999-02-05','Ohio'), ('Dinana','White',0,'1995-11-12','New York');"
    }
}

To execute the SQL create query in other DBMS, change the "DBMS" name from couchdb to neo4j, redis, mysql or sqlite. Then change the cFile to corresponding DBMS configuration file.

Support features:

  • Neo4j, CouchDB: the insert query must define column before define values. Example: INSERT INTO table (columnA, columnB) VALUES (valueA, valueB);
  • Redis: supported by rediSQL module

Continue to insert data for jobs table with the same syntax.