@ignisia/securedb
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

@Ignisia/SecureDB

Add encryption/decryption for Bun SQLite database for @ignisia/sql and @ignisia/nosql package.

Requirements

Installation

# Add @ignisia/securedb
bun add @ignisia/securedb

# Add @ignisia/sql if you are intend to use @ignisia/sql
bun add @ignisia/sql

# Add @ignisia/nosql if you are intend to use @ignisia/nosql
bun add @ignisia/nosql

Usage

import { SecureSqlDb, SecureNoSqlDb } from '@ignisia/securedb';

// For @ignisia/sql
await using db = await SecureSqlDb.define({
  // Define dialect
  dialect: 'sqlite',
  config: {
    // Location of the database to be stored
    filename: 'db.db',
  },
  // Password to encrypt/decrypt the database
  password: 'password',
  // Salt to encrypt/decrypt the database
  salt: 'salt',
});

// For @ignisia/nosql
await using db = await SecureNoSqlDb.define({
  // Location of the database to be stored
  filename: 'db.db',
  // Password to encrypt/decrypt the database
  password: 'password',
  // Salt to encrypt/decrypt the database
  salt: 'salt',
});

For functions that are implemented on the SecureSqlDb and SecureNoSqlDb is pretty much the same as the one exported from @ignisia/sql and @ignisia/nosql Note: @ignisia/securedb does not do any input validations, therefore it is your responsibility to validate the user input on your own.

Readme

Keywords

none

Package Sidebar

Install

npm i @ignisia/securedb

Weekly Downloads

49

Version

0.1.2

License

none

Unpacked Size

15.9 kB

Total Files

20

Last publish

Collaborators

  • krsbx