# knex-cordova-sqlite

> A driver or dialect for using knex with a Cordova or PhoneGap app

Latest version **1.0.5** (published 2021-06-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install knex-cordova-sqlite
pnpm add knex-cordova-sqlite
yarn add knex-cordova-sqlite
bun add knex-cordova-sqlite
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-06-21 |
| First published | 2020-06-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mark Wylde |
| Maintainers | markwylde |
| Keywords | cordova, phonegap, knex, sqlite, orm |

## Links

- npm: https://www.npmjs.com/package/knex-cordova-sqlite
- Repository: https://github.com/markwylde/knex-cordova-sqlite
- Homepage: https://github.com/markwylde/knex-cordova-sqlite#readme
- Issues: https://github.com/markwylde/knex-cordova-sqlite/issues
- npm.io page: https://npm.io/package/knex-cordova-sqlite

## Dependencies (1)

- [knex](https://npm.io/package/knex.md) ^0.95.6

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2021-06-21
- 1.0.4 — 2020-06-10
- 1.0.3 — 2020-06-10
- 1.0.2 — 2020-06-10
- 1.0.1 — 2020-06-10
- 1.0.0 — 2020-06-10

## README

# knex-cordova-sqlite
Allows you to use Knex inside a Cordova app.

## Prerequisites
This library does not actually provide any bindings to sqlite, but instead connects the [cordova-sqlite-storage](https://github.com/xpbrew/cordova-sqlite-storage) provided API to Knex.

Therefore, you need to add the cordova-sqlite-storage plugin to your app.

## Installation
```bash
npm install --save knex-cordova-sqlite
```

## Example Usage
```javascript
const knex = require('knex')({
  client: require('knex-cordova-sqlite'),
  connection: {
    filename: 'todos-' + Date.now() + '.db'
  }
});

async function init () {
  await knex.schema.createTable('todos', table => {
    table.increments('id');
    table.string('title');
  })
}

function addTodo (todo) {
  return knex('todos').insert(todo)
}

function getTodos () {
  return knex('todos').select('*')
}

module.exports = {
  init,
  addTodo,
  getTodos
}
```

---
_Source: https://npm.io/package/knex-cordova-sqlite · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
