ilink_updater
Version:
69 lines (44 loc) • 1.66 kB
Markdown
is a module that get a raw insert object from a queue, it makes the mysql query and turns it into an object ready to be inserted to the db using
sql_queue_processor module. Once it the object is transformed it puts it into a queue for that module to consume.
```js
var obj = { //the params depend on the db table params based on the query definitions made using query_builder_module
name: 'this is the name ', description: 'this is the description', tags: 'test|test2', id: 1
};//object must have an id this is the id of the row of the updated table
var Ins={client:1,//the id of the client
obj:obj,
query_name:"test_query"//name of query_definition
};
```
```js
var out={ db_name: 'test_db',//name of the client db
query_name: 'test_query',//name of query_definition
Q_arr: [ //as many as there where inserted objects
{ has_childs: false, //it object has child table (see next example)
object: [Object],// see description below,
tags: 'test|test2' }
],
make_cache: [ 'test_cache' ],
type: 'update' }
////////
var object={ table_name:
{ name: 'table_name',
update_id: 1,
query: 'update test_db.table_name set ? where id in (1) ',
inserted_obj:
{ name: 'the name ',
description: 'the description',
tags: 'test|test2' } } }
```
- [Install](
- [Introduction](
- [Input_object](
- [Output_object](
```sh
$ npm install ilink_insert
```
This