Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
OctaviaDB is a lightweight Node.js module for creating encrypted collections of data on the filesystem. It provides basic CRUD (Create, Read, Update, Delete) operations for collections and supports encryption for data security.
OctaviaDB is a lightweight Node.js module for creating encrypted collections of data on the filesystem and supports encryption for data security.
To install the OctaviaDB module, run the following command in your terminal:
npm install octavia-db
Encryption: OctaviaDB provides built-in encryption for your database to ensure data security.
Database Information: Retrieve information about the database and collections
Schema Validation: Validate data against predefined schemas to ensure data integrity and consistency.
// database methods
db.info()
db.delete()
db.collectionExists(collectionName)
// collection methods. `dataScheme` are optional
collection.info()
collection.delete()
collection.insert(dataObject, dataScheme)
collection.insertMany(arrayOfDataObjects, dataScheme)
collection.find(queryData)
collection.findMany(queryData)
collection.update(queryData, newData, dataScheme)
collection.updateMany(queryData, newData, dataScheme)
collection.remove(queryData)
collection.removeMany(queryData)
const { OctaviaDB } = require("octavia-db")
const db = new OctaviaDB({
database: 'myDatabase',
password: 'mySecretPassword',
});
db.Collection()
const userCollection = db.Collection(
'users', // collection name
true // encryption, default true
);
collection.insert()
const user = {
username: 'john_doe',
email: 'john.doe@example.com',
age: 30
};
try {
userCollection.insert(user)
} catch(error) {
console.log("Code:", error.code)
console.log("Message:", error.msg)
}
collection.insert()
with data schemeconst user = {
username: 'john_doe',
email: 'john.doe@example.com',
age: 30,
active: true,
languages: [
'c++',
'c',
'golang',
'js'
]
};
try {
userCollection.insert(user, {
username: String,
email: String,
age: Number,
active: Boolean,
languages: Array
})
} catch(error) {
console.log("Code:", error.code)
console.log("Message:", error.msg)
}
collection.insertMany()
const multipleUserData = [
{
username: "patrick_williams",
email: "patrick.williams@example.com",
age: 25
},
{
username: "jane_smith",
email: "jane.smith@example.com",
age: 25
},
{
username: "alex_johnson",
email: "alex.johnson@example.com",
age: 35
},
{
username: 'john_doe',
email: 'john.doe@example.com',
age: 25
}
];
try {
userCollection.insertMany(multipleUserData)
} catch(error) {
console.log("Code:", error.code)
console.log("Message:", error.msg)
}
collection.find()
try {
const foundUser = userCollection.find({ username: 'john_doe' })
console.log(result)
} catch(error) {
console.log("Code:", error.code)
console.log("Message:", error.msg)
}
collection.findMany()
try {
const users = userCollection.findMany({ age: 25 })
console.log(users);
} catch(error) {
console.log("Code:", error.code)
console.log("Message:", error.msg)
}
collection.update()
try {
const updatedUserData = {
age: 31,
city: 'New York'
};
const updated = userCollection.update({ username: 'alex_johnson' }, updatedUserData)
} catch(error) {
console.log("Code:", error.code)
console.log("Message:", error.msg)
}
collection.updateMany()
try {
const updatedUserData = {
status: "go to work"
};
const updated = userCollection.updateMany({ age: 25 }, updatedUserData)
} catch(error) {
console.log("Code:", error.code)
console.log("Message:", error.msg)
}
collection.remove()
try {
const removed = userCollection.remove({ username: 'alex_johnson' })
} catch(error) {
console.log("Code:", error.code)
console.log("Message:", error.msg)
}
collection.removeMany()
try {
const removed = userCollection.removeMany({ age: 25 })
} catch(error) {
console.log("Code:", error.code)
console.log("Message:", error.msg)
}
collection.info()
try {
const collectionInfo = userCollection.info()
console.log(collectionInfo)
} catch(error) {
console.log("Code:", error.code)
console.log("Message:", error.msg)
}
databaseName.info()
try {
const databaseInfo = db.info()
console.log(databaseInfo)
} catch(error) {
console.log("Code:", error.code)
console.log("Message:", error.msg)
}
collection.delete()
try {
const response = userCollection.delete()
} catch(error) {
console.log("Code:", error.code)
console.log("Message:", error.msg)
}
db.delete()
try {
const response = db.delete()
} catch(error) {
console.log("Code:", error.code)
console.log("Message:", error.msg)
}
const { OctaviaDB } = require("octavia-db")
try {
const DB = new OctaviaDB({
database: "database",
password: "mypassword"
})
const users = DB.Collection("users", false)
const insert = users.insert({
id: 1,
username: "madhan",
age: 20,
records: { r1: 1, r2: 2 },
languages: ["js", "c", "c++", "go", "php"],
deep: {
tags: {
a: true,
b: false
},
btns: {
text: "click",
className: "button",
index: 0
}
}
}, {
id: Number,
username: String,
age: Number,
records: Object,
languages: Array,
deep: {
tags: {
a: Boolean,
b: Boolean
},
btns: {
text: String,
className: String,
index: Number
}
}
})
console.log("[+] insert:", insert)
const insertMany = users.insertMany([
{
id: 2,
username: "madhan",
age: 20,
records: { r1: 1, r2: 2 },
languages: ["js", "c", "c++", "go", "php"],
deep: {
tags: {
a: true,
b: false
},
btns: {
text: "click",
className: "button",
index: 0
}
}
},
{
id: 3,
username: "madhan",
age: 25,
records: { r1: 1, r2: 2 },
languages: ["js", "c", "c++", "go", "php"],
deep: {
tags: {
a: true,
b: false
},
btns: {
text: "click",
className: "button",
index: 0
}
}
}
], {
id: Number,
username: String,
age: Number,
records: Object,
languages: Array,
deep: {
tags: {
a: Boolean,
b: Boolean
},
btns: {
text: String,
className: String,
index: Number
}
}
})
console.log("[+] insertMany:", insertMany)
const find = users.find({ age: 25 })
console.log("[+] find:", find)
const findMany = users.findMany({ age: 20 })
console.log("[+] findMany:", findMany)
const update = users.update({ age: 25 }, { status: "active" }, { status: String })
console.log("[+] update:", update)
const updateMany = users.updateMany({ age: 20 }, { status: "inActive" }, { status: String })
console.log("[+] updateMany:", updateMany)
const remove = users.remove({ age: 25 })
console.log("[+] remove:", remove)
const removeMany = users.removeMany({ age: 20 })
console.log("[+] removeMany:", removeMany)
console.log("[+] database information:", DB.info())
console.log("[+] collection information:", users.info())
const collectionDelete = users.delete()
console.log("[+] collectionDelete:", collectionDelete)
const databaseDelete = DB.delete()
console.log("[+] databaseDelete:", databaseDelete)
} catch (error) {
console.log("Message:", error.msg)
console.log("Code:", error.code)
}
FAQs
OctaviaDB is a lightweight Node.js module for creating encrypted collections of data on the filesystem. It provides basic CRUD (Create, Read, Update, Delete) operations for collections and supports encryption for data security.
We found that octavia-db demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.