# sqlite-sync

> Node module to sqlite sync and async

Latest version **0.3.9** (published 2019-08-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install sqlite-sync
pnpm add sqlite-sync
yarn add sqlite-sync
bun add sqlite-sync
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.9 |
| Published | 2019-08-16 |
| First published | 2015-11-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 2 |
| Unpacked size | 14.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 78 |
| Author | Jayr Alencar |
| Maintainers | jayralencar |
| Keywords | sqlite, sqlite3, sync, async, database |

## Links

- npm: https://www.npmjs.com/package/sqlite-sync
- Repository: https://github.com/JayrAlencar/sqlite-sync.js
- Homepage: https://github.com/JayrAlencar/sqlite-sync.js#readme
- Issues: https://github.com/JayrAlencar/sqlite-sync.js/issues
- npm.io page: https://npm.io/package/sqlite-sync

## Dependencies (2)

- [npm](https://npm.io/package/npm.md) ^6.4.1
- [sql.js](https://npm.io/package/sql.js.md) ^0.3.2

## Alternatives

- [@libsql/sqlite3](https://npm.io/package/@libsql/sqlite3.md) — 39.8K weekly downloads
- [@fortemi/core](https://npm.io/package/@fortemi/core.md) — 461 weekly downloads
- [cdb-converter](https://npm.io/package/cdb-converter.md) — 341 weekly downloads
- [@uplo/adapter-prisma](https://npm.io/package/@uplo/adapter-prisma.md) — 75 weekly downloads
- [typeorm-aios](https://npm.io/package/typeorm-aios.md) — 30 weekly downloads

## Recent versions

- 0.3.9 (latest) — 2019-08-16
- 0.3.8 — 2018-04-18
- 0.3.7 — 2018-04-04
- 0.3.6 — 2016-11-25
- 0.3.5 — 2016-04-26
- 0.3.4 — 2016-04-19
- 0.3.3 — 2016-04-08
- 0.3.2 — 2016-03-31
- 0.3.1 — 2016-03-30
- 0.3.0 — 2016-03-30
- 0.2.1 — 2016-03-21
- 0.2.0 — 2016-03-20
- 0.1.10 — 2016-01-12
- 0.1.9 — 2015-11-26
- 0.1.8 — 2015-11-25
- … 7 more at https://npm.io/package/sqlite-sync/versions

## README

# sqlite-sync.js
Node module to sqlite sync and async</br>
[![NPM](https://nodei.co/npm/sqlite-sync.png?downloads=true&downloadRank=true)](https://nodei.co/npm/sqlite-sync/)

node.js package for database connection with <strong> SQLite </strong>, and execute SQL commands synchronously or asynchronously.

# Install
```shell
npm install sqlite-sync
```

# Usage
```js
var sqlite = require('sqlite-sync'); //requiring

//Connecting - if the file does not exist it will be created
sqlite.connect('test/test.db'); 

//Creating table - you can run any command
sqlite.run("CREATE TABLE COMPANYS(ID  INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT NOT NULL);",function(res){
	if(res.error)
		throw res.error;
	console.log(res);
});

//Inserting - this function can be sync to, look the wiki
sqlite.insert("COMPANYS",{NAME:"My COMPANY"}, function(res){
	if(res.error)
		throw res.error;
	console.log(res);
});

//Updating - returns the number of rows modified - can be async too
var rows_modified = sqlite.update("COMPANYS",{NAME:"TESTING UPDATE"},{ID:1});

//Create your function
function test(a,b){
	return a+b;
}

//Add your function to connection
sqlite.create_function(test);

// Use your function in the SQL
console.log(sqlite.run("SELECT ID, test(NAME, ' Inc') as NAME FROM COMPANYS"));

// Closing connection 
sqlite.close();

```

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