Socket
Socket
Sign inDemoInstall

simdatabase

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    simdatabase

A simple module for storing and managing data


Version published
Maintainers
1
Created

Readme

Source

Installing

Just installing module

$ npm install simple-databse

Quick start

Creating file with

import { SimpleDatabase } from 'simple-database'
const simd = new SimpleDatabase('example.simd')

Adding table columns

simd.addColumn('id', 'number', {
  unique: true
})

// or multi-adding columns

simd.addColumns([{
  name: 'name',
  type: 'string',
  default: 'No Name',
  unique: true
}, {
  name: 'suranme',
  type: 'string',
  unique: true
}])

Insert, update and delete data from table

// inserting into table
simd.insert({
  id: 12345,
  name: 'Kio',
  surname: 'gia'
})

// updating columns where "id" == 12345
simd.update({
  surname: 'Gia'
}, {
  column: 'id',
  operand: 12345
}) 

// delete columns where "name" != Kio
simd.delete({
  column: 'name',
  operator: '!=',
  operand: 'Kio'
})

Getting data

// selecting rows where "name" == Kio
simd.select({
  column: 'name',
  operand: 'Kio'
})
// returns [] 

// or selecting rows where unique column "id" == 12345
simd.selectByUnique({
  column: 'id',
  operand: 12345
})
// returns {} or undefined

// forEach loop 
simd.forEach((row, rowIndex, rows) => {
  // some operation
})

// or select all rows 
simd.getAll
// returns []

Classes

SimpleDatabase

Soon...

Visualizer

Soon...

Keywords

FAQs

Last updated on 22 Jan 2023

Did you know?

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc