nano-react-native
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Nano-React-Native

React Native Driver for nanoSQL

nanoSQL Logo

NPM

Documentation

This is an adapter written for NanoSQL that wraps React Native's built in AsyncStorage class, lets you use nanoSQL in your React Native projects with persistence to disk.

Installation

npm i --save nano-react-native

Usage

import { nSQL } from "nano-sql";
import { ReactNativeAdapter } from "nano-react-native";
 
nSQL("users")
.model([
    {key: "id", type: "uuid", props: ["pk"]},
    {key: "name", type: "string"}
])
.config({
    mode: new ReactNativeAdapter() // required
}).connect().then(() => {
    nSQL("users").query("upsert", {name: "Billy"}).exec().then(() => {
        return nSQL("users").query("select").exec();
    }).then((rows) => {
        console.log(rows);
    })
})

That's it, now everything nanoSQL can do you can do with React Native.

Read about nanoSQL here.

Package Sidebar

Install

npm i nano-react-native

Homepage

nanosql.io

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

23.1 kB

Total Files

7

Last publish

Collaborators

  • clicksimply