Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Latest commit

 

History

History
24 lines (18 loc) · 570 Bytes

README.md

File metadata and controls

24 lines (18 loc) · 570 Bytes

abstr-dbi

Database independent interface

Screenshot


Example of use with the MongoDB driver

const DBI = require('abstr-dbi')
const dbi = DBI({ driver: 'mongodb' })

const database = 'mongodb://localhost:27017/abstr_dbi_test'

console.log(`Connecting to ${database}...`)
dbi.connect({connectionParams:database})
    .then(() => {
        console.log(`Connected to database successfully! Engine [ ${dbi.EngineType} ]`)
    })
    .catch((err) => {
        console.log('Failed to connect database', err.stack)
    })