1.5.5 • Published 10 years ago

data-service v1.5.5

Weekly downloads
8
License
MIT
Repository
github
Last release
10 years ago

NPM

Build Status

#Data Service

Config File:

{
    "host": "127.0.0.1",
    "database": "database",
    "port": "3306",
    "user": "user",
    "password": "password"
}

Sample Code:

var data_service = require('data-service');
var config = require('./config/mysql.json');
var service = "mysql";
var table = "table";
var id = {id: id};
var data = {field1:"field1", field2:"field2", field3:"field3"};
  
// Connect
data_service.Connect(service, config, function(data) {
    console.log(data);
});
  
// Create
data_service.Create(service, table ,id ,data ,function(data) {
    console.log(data);
});
  
// Read
data_service.Read(service, table ,id ,data ,function(data) {
    console.log(data);
});
  
// Update
data_service.Update(service, table ,id ,data ,function(data) {
    console.log(data);
});
  
// Delete
data_service.Delete(service, table ,id ,data ,function(data) {
    console.log(data);
});
  
// Destroy
data_service.Destroy(service, function(data) {
    console.log(data);
});

Installation

$ npm install data-service

Install dependencies:

$ npm install

Start the example:

Step 1:

$ git clone https://github.com/LeoYehTW/data-service.git
$ npm install
$ node example.js

Step 2: Open "Data Service - Management" Website. (http://127.0.0.1:5000)

Step 3: Change database connection information.

General CRUD Function

  • Create
  • Read
  • Update
  • Delete

Support

Contributors

License

MIT

1.5.5

10 years ago

1.5.4

10 years ago

1.5.3

10 years ago

1.5.2

10 years ago

1.5.1

10 years ago

1.5.0

10 years ago

0.0.1

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago