How to use pouchdb-adapter-react-native-sqlite - 3 common examples

To help you get started, we’ve selected a few pouchdb-adapter-react-native-sqlite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bailabs / tailpos / src / store / PosStore / PrinterStore.js View on Github external
import { types, getRoot, destroy } from "mobx-state-tree";
import { assignUUID } from "./Utils";
import { Alert } from "react-native";
import PouchDB from "pouchdb-react-native";

import SQLite from "react-native-sqlite-2";
import SQLiteAdapterFactory from "pouchdb-adapter-react-native-sqlite";
const SQLiteAdapter = SQLiteAdapterFactory(SQLite);
PouchDB.plugin(SQLiteAdapter);
const db = new PouchDB("printers.db", { adapter: "react-native-sqlite" });
const dbc = new PouchDB("company.db", { adapter: "react-native-sqlite" });
const dbb = new PouchDB("bluetoothscanner.db", {
  adapter: "react-native-sqlite",
});
const dbd = new PouchDB("sync.db", {
  adapter: "react-native-sqlite",
});
PouchDB.plugin(require("pouchdb-find"));
PouchDB.plugin(require("pouchdb-upsert"));

let rowsOptions = {};

export const Printer = types
  .model("Printer", {
github cliqz-oss / browser-core / platforms / react-native / database.es View on Github external
/**
 * PouchDB using sqlite adapter
 * see https://github.com/craftzdog/react-native-sqlite-2
 */
import PouchDB from 'pouchdb-react-native';
import SQLite from 'react-native-sqlite-2';
import SQLiteAdapterFactory from 'pouchdb-adapter-react-native-sqlite';

const SQLiteAdapter = SQLiteAdapterFactory(SQLite);
PouchDB.plugin(SQLiteAdapter);

export default function (dbName, options) {
  return new PouchDB(dbName, Object.assign({ adapter: 'react-native-sqlite' }, options));
}
github bailabs / tailpos / src / store / PosStore / DbFunctions.js View on Github external
export function openAndSyncDB(dbName, withSync = false) {
  const SQLiteAdapter = SQLiteAdapterFactory(SQLite);
  PouchDB.plugin(SQLiteAdapter);
  const db = new PouchDB(dbName + ".db", { adapter: "react-native-sqlite" });
  PouchDB.plugin(require("pouchdb-find"));
  PouchDB.plugin(require("pouchdb-upsert"));
  return db;
}

pouchdb-adapter-react-native-sqlite

PouchDB adapter using ReactNative SQLite Plugin as its data store.

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular pouchdb-adapter-react-native-sqlite functions

Similar packages