# react-native-spatialite

> React Native Spatialite Plugin for Android.

Latest version **0.1.0** (published 2017-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-spatialite
pnpm add react-native-spatialite
yarn add react-native-spatialite
bun add react-native-spatialite
```

## 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.1.0 |
| Published | 2017-02-24 |
| First published | 2017-02-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | INDEC |
| Maintainers | navarroaxel |
| Keywords | react-native, android, sqlite, spatialite |

## Links

- npm: https://www.npmjs.com/package/react-native-spatialite
- Repository: https://github.com/indec-it/react-native-spatialite
- Homepage: https://github.com/indec-it/react-native-spatialite#readme
- Issues: https://github.com/indec-it/react-native-spatialite/issues
- npm.io page: https://npm.io/package/react-native-spatialite

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2017-02-24

## README

# react-native-spatialite

React Native Spatialite Plugin for Android

## Getting started

`$ npm install react-native-spatialite --save`

### Manual installation

#### Android

1. Open up `android/app/src/main/java/[...]/MainActivity.java`
  - Add `import ar.gov.indec.react.spatialite.SpatialiteReactPackage;` to the imports at the top of the file
  - Add `new SpatialiteReactPackage()` to the list returned by the `getPackages()` method

2. Append the following lines to `android/settings.gradle`:

  	```
  	include ':react-native-spatialite'

  	project(':react-native-spatialite').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-spatialite/android')
  	```

3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:

  	```
    compile project(':react-native-spatialite')
  	```

4. Add JitPack in `android/build.gradle` as repository
    ```
    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
            ...
        }
    }
    ```

## Usage
```javascript
import db from 'react-native-spatialite';

db.createConnection('test.db').then(connected => {
    console.log('Database is connected', connected);
    return db.getVersion();
}).then(
    array => {
        console.log({arr});
        return db.executeQuery('SELECT * FROM MyTable');
    }
).then(
    rows => {
        console.log({rows});
    }
).catch(
    err => {
        throw err;
    }
);
```

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