https://github.com/bes-js/cherry3-lite
Cherry3 is a SQlite object modeling tool designed to work in an asynchronous environment.
https://github.com/bes-js/cherry3-lite
database db quick sequelize sqlite
Last synced: 10 months ago
JSON representation
Cherry3 is a SQlite object modeling tool designed to work in an asynchronous environment.
- Host: GitHub
- URL: https://github.com/bes-js/cherry3-lite
- Owner: Bes-js
- License: apache-2.0
- Created: 2024-04-05T15:45:36.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-23T20:07:19.000Z (over 1 year ago)
- Last Synced: 2025-03-19T20:43:36.079Z (10 months ago)
- Topics: database, db, quick, sequelize, sqlite
- Language: JavaScript
- Homepage: https://discord.gg/luppux
- Size: 51.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Cherry3 is a SQlite object modeling tool designed to work in an asynchronous environment.
#
## Installation
Using npm:
```shell
$ npm install cherry3-lite
```
Using yarn:
```bash
$ yarn add cherry3-lite
```
Using pnpm:
```bash
$ pnpm add cherry3-lite
```
#
## Features
* **Simple Setup:** Get started quickly with minimal configuration.
* **SQlite Storage:** Sqlite Will Come To Your Help Because It Is Compressed, Economical And Fast.
* **Asynchronous Operations:** Perform Database Operations Asynchronously Using Promises.
* **Filter and Update:** Easily filter and update records in your collections.
#
## Usage
```js
import db from 'cherry3-lite';
/* const db = require('cherry3-lite'); For CommonJS */
var data;
(async () => {
data = await db.set('test',5);
console.log(data); // => 5
data = await db.get('test');
console.log(data); // => 5
data = await db.delete('test');
console.log(data); // => true
data = await db.has('test');
console.log(data); // => false
data = await db.fetch('test');
console.log(data); // => null
data = await db.add('test',6);
console.log(data); // => 6
data = await db.sub('test',1);
console.log(data); // => 5
data = await db.inc('test',2);
console.log(data); // => 7
data = await db.dec('test',2);
console.log(data); // => 5
data = await db.all();
console.log(data);
/*
[{
id:2,
key:'test',
value:5
}]
*/
data = await db.fetchAll();
console.log(data);
/*
[{
id:2,
key:'test',
value:5
}]
*/
data = await db.type('test');
console.log(data); // => number
data = await db.push('testArray',1);
console.log(data); // => [1]
data = await db.push('testArray',[2,3,4,5]);
console.log(data); // => [1,2,3,4,5]
data = await db.pull('testArray',3);
console.log(data); // => [1,2,4,5]
data = await db.pull('testArray',[1,2,4]);
console.log(data); // => [5]
data = db.version;
console.log(data) // => 1.0.0
})();
```
#
## Settings File Definitions
[*=>* **Click Here**](https://fivesobes.gitbook.io/cherry3/sql-config-file)
#
## Sqlite Viewer Extension
[For Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=yy0931.vscode-sqlite3-editor)
## License
Cherry3 is licensed under the **Apache License 2.0** License. See the [LICENSE](./LICENSE.md) file for details.
## Changelog
[*=>* **Click Here**](./CHANGELOG.md)
## Support
[](https://discord.gg/luppux)