1.3.3 • Published 4 years ago

db-avatar-init v1.3.3

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

Table of contents

  1. Install
  2. Introduction
  3. Concepts
  4. Examples
  5. Configuration
  6. Test
  7. Help
  8. License
npm install db-avatar-init

db-viewer is a package of modules. Its main objective is to easily configure and use different databases.

Usage

'use strict' 

const DBViewer = require('db-avatar-init')

const options = {
  dbId: 000000,
  viewName: 'xxxxx.sql',
  user: 'xxxxx',
  password: 'xxxx'
};

DBViewer.executeView(options, (error, data) => {
  if(error) {
    console.log(error.message)
  } else {
    console.log(data)
  }
})

Add: in your package.json

"scripts": {
  "init-db": "init-db",
  "init-api": "init-api",
  "server": "node ./.apiserver/index.js"
},

Execute: Create api folder to root path

 npm run init-db

Start: Start server REST API

npm run server

Environment Variables: Environment Variables API configuration

Environment variable for Authentication

  • USER_TEMP_API={{username to login}}
  • PASS_TEMP_API={{username passwordto login}}
  • SECRET_PASS_API={{secreat to create token}}

Environment variable app

  • NODE_API_DB_PORT={{application port}}

Execute: to call api rest

 npm run init-api
Do you want to login? :: [Y, N] : 

Enter user body request: {"logonId": "XXXXXXX", "logonPassword": "XXXXXXXXX"}
----------------------------------------------------

status 200

 What do you want to do? [LIST, INSERT]
 list
----------------------------------------------------------------------------------
[
  {
    id: 1580319420028,
    type: 'MARIADB',
    connection: {
      id: 12111121,
      database: 'xxxxxxx',
      hostname: 'xxxx',
      port: 'xxxxxx',
      user: 'xxxxxx',
      password: ''
    },
    views: [ [Object] ]
  }
]

insert
----------------------------------------------------------------------------------
 
  Enter new DB in json format: 
  ----------------------------------------------------
{ "id": 111111, "type": "xxxx", "connection": { "id": 111111,"database": "xxxx", "hostname": "xxxxxx", "port": "xxxx", "user": "xxxx" }, "views": [{ "name": "xxx.sql", "path": "views/mariadb/xxx.sql", "query": "SELECT * FROM xxxxxxx;"}]}
status response:  200

Note: Not all options are currently supported.

MIT

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.2.20

4 years ago

1.2.17

4 years ago

1.2.18

4 years ago

1.2.19

4 years ago

1.2.16

4 years ago

1.2.15

4 years ago

1.2.14

4 years ago

1.2.13

4 years ago

1.2.12

4 years ago

1.2.11

4 years ago

1.2.10

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.20

4 years ago

1.1.19

4 years ago

1.1.18

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.17

4 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.1.12

4 years ago

1.1.11-n

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago