
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
TypeScript PostgreSQL database module ready to be thrown into your Discord bot.
Writing your bot's database can be a pain. As you develop your bot, you will constantly modify your schema, risking losing data if you don't migrate it. NatsukiDB solves that issue by allowing you to have a premade database ready to be thrown into your bot. It is designed to store all the data you need plus more.
NatsukiDB is the database module for the Natsuki Discord bot, made public so anyone can have a premade database for their bot as well.
The purpose of the database being its own module, is to make the parent bot more modular, like a micro-service for the bot. It also allows the database to easily be reused in a web interface for the bot, using Angular 5.
Feel free to suggest new entities/columns, or even create a Pull Request to add your own changes. If I like it, I may even implement it into the Natsuki bot.
$ npm i -s natsuki-db
First we need to import the module.
import { connect, Connection } from 'natsuki-db'
At the basic level, we need to connect to the database, so we import the connect method. The connect method returns a Promise of type Connection so we can import that also.
The connect method expects an object with a few connection options: host, username, password, database, and port.
// Preferably, you should store these externally, like in a json file. This is just for example.
const options = {
host: 'localhost'
username: 'postgres',
password: '',
database: 'postgres',
port: 5432
}
connect(options)
.then((connection: Connection) => {
// Connection successful, woohoo!
})
.catch((error: Error) => {
// Handle error
})
Alternatively, you can use async/await to connect.
const connection: Connection = await connect(options)
All methods in the module return a promise.
The module itself does not handle any exceptions, it simply executes something and immediately returns the result. You will have to handle the exceptions on your end.
There are several tables in the database. NatsukiDB uses a relational database, PostgreSQL, allowing the database to be composed of several small tables for the fastest queries.
Global information about the user.
User's credit balance and net worth.
User's level and XP.
User's profile settings.
User's information about the guilds they are in.
User's reputation, given from other members.
User's warning logs from all servers they received a warning.
User's kick logs from all servers they were kicked from.
User's ban logs from all servers they were banned from.
FAQs
TypeScript PostgreSQL database module ready to be thrown into your Discord bot.
We found that natsuki-db demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.