Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@soinlabs/db

Package Overview
Dependencies
Maintainers
6
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@soinlabs/db

A package to connect to different data bases

  • 1.1.0-alpha.66
  • npm
  • Socket score

Version published
Weekly downloads
281
decreased by-8.77%
Maintainers
6
Weekly downloads
 
Created
Source

@soinlabs/db - Database and ORM Library

codecov npm version npm downloads

Description

  • Library to encapsulate ORM schema and logic in order to support multiple database dialects based on multiple Object-Relational Mappers

How to use

Create db connection and execute raw queries

  • Open a simple connection
const dbOrm = new DbOrm()
dbOrm.initialize({
  orm: 'sequelize',
  dialect: 'postgres',
  version: '12.5.0',
  host: 'your_db_host',
  database: 'your_db_name',
  username: 'your_db_username',
  password: 'your_db_password',
  port: 5432,
  synchronize: false,
})

const db = new DbOrm({
  orm: 'sequelize',
  dialect: 'postgres',
  version: '12.5.0',
  host: 'your_db_host',
  database: 'your_db_name',
  username: 'your_db_username',
  password: 'your_db_password',
  port: 5432,
  synchronize: false,
})
  • Test your connection
testConnection = async () => {
  const result = await dbOrm.test()
  return result
}
  • Perform raw queries
async function demo() {
  const result = await db.execute(`SELECT * FROM your_table`)
  return result
}

Keywords

FAQs

Package last updated on 10 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc