https://github.com/akrouk/promisesql
A node-sqlite3 wrapper for lightweight, asynchronous queries
https://github.com/akrouk/promisesql
discordjs discordjs-v13 node-sqlite3 nodejs sqlite3
Last synced: about 2 months ago
JSON representation
A node-sqlite3 wrapper for lightweight, asynchronous queries
- Host: GitHub
- URL: https://github.com/akrouk/promisesql
- Owner: akrouk
- License: mit
- Created: 2022-05-07T05:38:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-16T19:55:17.000Z (almost 3 years ago)
- Last Synced: 2025-02-19T09:21:17.013Z (11 months ago)
- Topics: discordjs, discordjs-v13, node-sqlite3, nodejs, sqlite3
- Language: JavaScript
- Homepage:
- Size: 1.19 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# :hatching_chick: PromiseSQL
A [node-sqlite3](https://www.npmjs.com/package/sqlite3) wrapper for running simple, asynchronous database queries in Node.js. PromiseSQL is for those who take their coffee with syntactic sugar instead of black ☕. It's best suited for smaller projects that require resolving lots of promises, e.g., a Discord bot that implements slash commands.
```javascript
const db = require('promisesql');
db.open('./database.db');
(async () => {
const data = await db.select({
all: true,
from: 'lorem',
where: [ db.expression.eq('ipsum', 'dolor') ]
});
data.forEach(datum => console.log(datum.dolor));
})();
db.close();
```
***This module is still a work in progress.***
By design, it was created as an SQL backend for interaction-based Discord bots built in [discord.js v13](https://discord.js.org/#/docs/discord.js/v13/general/welcome). It is intended to create more user-friendly, asynchronous query functions, which take in an "options" object as arguments, a practice inspired by discord.js.
# Documentation
Documentation can be found on the [wiki](https://github.com/akrouk/PromiseSQL/wiki/Documentation).