0.1.9 • Published 3 years ago

t1-spatialite v0.1.9

Weekly downloads
24
License
MIT
Repository
-
Last release
3 years ago

t1-spatialite

React Native Spatialite package for iOS and Android.

Getting started

$ npm install t1-spatialite --save

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.technologyonecorp.spatialite.SpatialiteReactPackage; to the imports at the top of the file
  • Add new SpatialiteReactPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:

    include ':t1-spatialite'
    
    project(':t1-spatialite').projectDir = new File(rootProject.projectDir, '../node_modules/t1-spatialite/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:

    compile project(':t1-spatialite')
  3. Add JitPack in android/build.gradle as repository

    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
            ...
        }
    }

iOS

  1. $ react-native link

Usage

import db from 't1-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;
    }
);
0.1.9

3 years ago

0.1.8

4 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago