Skip to content
This repository was archived by the owner on Jan 1, 2025. It is now read-only.

Commit 13b32dc

Browse files
authored
Merge pull request #243 from plexidev/dev
[Version update] 9.1.0
2 parents b7c792a + 62f180b commit 13b32dc

49 files changed

Lines changed: 13770 additions & 8040 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212
],
1313
rules: {
1414
"@typescript-eslint/no-explicit-any": 0,
15+
"@typescript-eslint/explicit-function-return-type": 1,
1516
"@typescript-eslint/no-non-null-assertion": 0,
1617
"no-console": 2,
1718
},

.github/workflows/codeql.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "dev" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "dev" ]
20+
schedule:
21+
- cron: '15 9 * * 5'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Use only 'java' to analyze code written in Java, Kotlin or both
38+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
39+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v3
44+
45+
# Initializes the CodeQL tools for scanning.
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v2
48+
with:
49+
languages: ${{ matrix.language }}
50+
# If you wish to specify custom queries, you can do so here or in a config file.
51+
# By default, queries listed here will override any specified in a config file.
52+
# Prefix the list here with "+" to use these queries and those in the config file.
53+
54+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
55+
# queries: security-extended,security-and-quality
56+
57+
58+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
59+
# If this step fails, then you should remove it and run the build manually (see below)
60+
- name: Autobuild
61+
uses: github/codeql-action/autobuild@v2
62+
63+
# ℹ️ Command-line programs to run using the OS shell.
64+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
65+
66+
# If the Autobuild fails above, remove it and uncomment the following three lines.
67+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
68+
69+
# - run: |
70+
# echo "Run, Build Application using script"
71+
# ./location_of_script_within_repo/buildscript.sh
72+
73+
- name: Perform CodeQL Analysis
74+
uses: github/codeql-action/analyze@v2
75+
with:
76+
category: "/language:${{matrix.language}}"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
# Modified to build with node
3+
name: Deploy built static content to Pages
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["dev"]
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
jobs:
21+
# Build job
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v3
26+
- name: Use Node.js 18.x
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
cache: "npm"
31+
- run: npm ci
32+
- run: npm run docgen
33+
34+
- name: Setup Pages
35+
id: pages
36+
uses: actions/configure-pages@v3
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v1
39+
with:
40+
path: ./docs
41+
42+
# Single deploy job
43+
deploy:
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
47+
runs-on: ubuntu-latest
48+
needs: build
49+
steps:
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v1

.github/workflows/node.js.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: ["dev"]
9+
pull_request:
10+
branches: ["dev"]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [18.x]
19+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: "npm"
28+
- run: npm ci
29+
- run: npm run build --if-present
30+
- run: npm test
31+
- run: npm run lint

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ build/Release
4545

4646
# Dependency directories
4747
node_modules/
48+
package-lock.json
4849
jspm_packages/
4950
pnpm-lock.yaml
5051

@@ -133,4 +134,6 @@ dist
133134
.svelte-kit
134135

135136
# End of https://www.toptal.com/developers/gitignore/api/node
136-
out
137+
out
138+
139+
.tool-versions

.husky/pre-commit

Lines changed: 0 additions & 5 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
2+
"recommendations": [
3+
"esbenp.prettier-vscode",
4+
"dbaeumer.vscode-eslint",
5+
"Gruntfuggly.todo-tree"
6+
]
37
}

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"editor.defaultFormatter": "esbenp.prettier-vscode",
3-
"editor.tabSize": 4
3+
"editor.tabSize": 4,
4+
"[typescript]": {
5+
"editor.defaultFormatter": "vscode.typescript-language-features"
6+
}
47
}

README.md

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
> Need a powerful, low-cost VPS for hosting your applications & bots 24/7? Check out our partner, [Contabo](https://www.tkqlhce.com/click-8950879-15301134)! 🎉
2-
3-
## Quick.db
1+
## ![Quick.db Logo](https://www.plexidev.org/quickdb.png)
42

3+
> Need a powerful, low-cost VPS for hosting your applications & bots 24/7? Check out our partner, [Contabo](https://www.tkqlhce.com/click-8950879-15301134)! 🎉
54
65
**Documentation:** [quickdb.js.org](https://quickdb.js.org) [[Migration Guide](https://quickdb.js.org/overview/migration-guide)] <br>
76
**Support:** [discord.gg/plexidev](https://discord.gg/plexidev) <br>
87
**NPM:** [npmjs.com/quick.db](https://www.npmjs.com/package/quick.db)
98

10-
Quick.db is an open-source package meant to provide an easy way for beginners and people of all levels to access & store data in a low to medium volume environment. All data is stored persistently via either [better-sqlite3](https://github.com/JoshuaWise/better-sqlite3) or [promise-mysql](https://www.npmjs.com/package/promise-mysql) and comes way various other quality-of-life features.
9+
Quick.db is an open-source package meant to provide an easy way for beginners and people of all levels to access & store data in a low to medium volume environment. All data is stored persistently via either [better-sqlite3](https://github.com/JoshuaWise/better-sqlite3) or [mysql2](https://www.npmjs.com/package/mysql2) and comes way various other quality-of-life features.
1110

1211
- **Persistent Storage** - Data doesn't disappear through restarts
13-
- **Multiple Drivers** - You can use either better-sqlite3 or promise-mysql
12+
- **Multiple Drivers** - You can use either better-sqlite3 or mysql2
1413
- **Works out of the box** - No need to set up a database server, all the data is stored locally in the same project
1514
- **Beginner Friendly** - Originally created for use in tutorials, the documentation is straightforward and jargon-free
1615
- & more...
@@ -31,7 +30,7 @@ Quick.db is an open-source package meant to provide an easy way for beginners an
3130

3231
```python
3332
npm i quick.db better-sqlite3 # (Default) Local SQLite3 File
34-
npm i quick.db promise-mysql # (Alternative) MySQL Server Connection
33+
npm i quick.db mysql2 # (Alternative) MySQL Server Connection
3534
```
3635

3736
> If you're having troubles installing, please follow [this troubleshooting guide](https://github.com/JoshuaWise/better-sqlite3/blob/master/docs/troubleshooting.md).
@@ -56,7 +55,7 @@ const db = new QuickDB(); // will make a json.sqlite in the root folder
5655
// -> { difficulty: 'Easy' }
5756

5857
// Getting an object property from the database:
59-
await db.set("userInfo.difficulty");
58+
await db.get("userInfo.difficulty");
6059
// -> 'Easy'
6160

6261
// Setting an object in the database:
@@ -85,7 +84,7 @@ const db = new QuickDB(); // will make a json.sqlite in the root folder
8584

8685
## Example With MySQLDriver
8786

88-
> **NOTE:** In order to use this driver, install `npm i promise-mysql` separately.
87+
> **NOTE:** In order to use this driver, install `npm i mysql2` separately.
8988
9089
```js
9190
const { QuickDB, MySQLDriver } = require("quick.db");
@@ -107,6 +106,52 @@ const { QuickDB, MySQLDriver } = require("quick.db");
107106
})();
108107
```
109108

109+
## Example With MongoDriver
110+
111+
> **NOTE:** In order to use this driver, install `npm i mongoose` separately.
112+
113+
```js
114+
const { QuickDB, MongoDriver } = require("quick.db");
115+
(async () => {
116+
const mongoDriver = new MongoDriver("mongodb://localhost/quickdb");
117+
118+
await mongoDriver.connect();
119+
120+
const db = new QuickDB({ driver: mongoDriver });
121+
// Now you can use quick.db as normal
122+
123+
await db.set("userInfo", { difficulty: "Easy" });
124+
// -> { difficulty: 'Easy' }
125+
126+
await driver.close();
127+
// disconnect from the database
128+
})();
129+
```
130+
131+
## Example With JSONDriver
132+
133+
> **NOTE:** In order to use this driver, install `npm i write-file-atomic` separately.
134+
135+
```js
136+
const { QuickDB, JSONDriver } = require("quick.db");
137+
const jsonDriver = new JSONDriver();
138+
const db = new QuickDB({ driver: jsonDriver });
139+
140+
await db.set("userInfo", { difficulty: "Easy" });
141+
```
142+
143+
## Example With MemoryDriver
144+
145+
> **Note:** In-memory database is not persistent and is suitable for temporary caching.
146+
147+
```js
148+
const { QuickDB, MemoryDriver } = require("quick.db");
149+
const memoryDriver = new MemoryDriver();
150+
const db = new QuickDB({ driver: memoryDriver });
151+
152+
await db.set("userInfo", { difficulty: "Easy" });
153+
```
154+
110155
## Changes in 9.0.x
111156

112157
- Added two new database options: **driver** and **filePath**

babel.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)