open-index/open-npm huggingface dataset:
npm package: @marsniper27/sqlite
Description: SQLite Provider for JOSH
Author: Evelyne Lachance
Latest version: 1.0.1

# SQLite Provider for JOSH

The SQLite provider uses better-sqlite3 for persistent storage of JOSH data.

## Installation

This provider requires building better-sqlite3 from source, so you'll need to make sure your system
is ready for that. 

### Pre-Requisites

**On Windows**:

- In an ADMIN POWERSHELL WINDOW, run `npm i -g --add-python-to-path --vs2015 --production windows-build-tools`
- In the same Admin PowerShell Window, run `npm i -g node-gyp`
- Close that admin powershell, and any command prompt or powershell used in your project (including VSCode if its terminal is open)
- Open a new, regular powershell or command prompt in your project folder

**On Linux**:
- Ensure you have the build tools and python installed. 
- On Debian, build tools are `sudo apt-get install build-essential`
- To check the python is there: `python --version` , it should be 2.x or 3.x

### Running the installer

In your project folder, assuming the above pre-requisites are followed, you should be able to just install using this command: 

```
npm i @marsnipe27/sqlite
** OR **
yarn add @marsnipe27/sqlite
```

## Usage

Using the sqlite provider goes as such: 

```js
const Josh = require('@marsnipe27/core');
const JoshSQlite = require('@marsnipe27/sqlite');

const db = new Josh({
  name: 'testing',
  provider: JoshSQlite,
});

db.defer.then( async () => {
  console.log(`Connected, there are ${await db.size} rows in the database.`);
});
```