UNPKG

sqmicro-connection

Version:

Connection abstraction for SQ Micro.

23 lines (17 loc) 600 B
# Общие инструменты для компонентов sqmicro: обзор ## Инсталляция ``` npm install --save sqmicro-connection ``` ## Использование Класс «соединение». ```javascript // Use pg driver from sqmicro-driver-pg module. const { Connection } = require('sqmicro-commons')('pg'); const connectionString = 'postgresql://user:password@localhost:5432/dbname'; const connection = new Connection({ connectionString }); connection.connect().then( () => console.log(`connected to the ${connection.safeUrl}`), console.error ); ```