How to use the react-native-sqlite-storage.DEBUG function in react-native-sqlite-storage

To help you get started, we’ve selected a few react-native-sqlite-storage 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 blefebvre / react-native-sqlite-demo / src / database / Database.ts View on Github external
public open(): Promise {
    SQLite.DEBUG(true);
    SQLite.enablePromise(true);
    let databaseInstance: SQLite.SQLiteDatabase;

    return SQLite.openDatabase({
      name: DATABASE.FILE_NAME,
      location: "default"
    })
      .then(db => {
        databaseInstance = db;
        console.log("[db] Database open!");

        // Perform any database initialization or updates, if needed
        const databaseInitialization = new DatabaseInitialization();
        return databaseInitialization.updateDatabaseTables(databaseInstance);
      })
      .then(() => {
github prsn / redux-persist-sqlite-storage / examples / rn / ReduxPersistSQLiteExample / store.js View on Github external
import {createLogger} from 'redux-logger';
import thunk from 'redux-thunk';
import todoReducer from './reducers/todo-reducers';
// import storage from 'redux-persist/lib/storage';
import SQLite from 'react-native-sqlite-storage';
import SQLiteStorage from 'redux-persist-sqlite-storage';

const storeEngine = SQLiteStorage(SQLite);
// import logger from 'redux-logger';
const logger = createLogger({
  collapsed: true,
  duration: true,
  logErrors: true
});

SQLite.DEBUG(true);
SQLite.enablePromise(true);


const persistConfig = {
  storage: storeEngine,
  debug: true
};
// const persistedReducer = persistReducer(persistConfig, todoReducer);
// let store = createStore(persistedReducer, {}, applyMiddleware([thunk, logger]));

const store = createStore(
  todoReducer,
  undefined,
  compose(applyMiddleware(thunk, logger),
  autoRehydrate())
);
github longlongago2 / react-native-sqlite-helper / sqliteHelper.js View on Github external
import SQLiteStorage from 'react-native-sqlite-storage';

SQLiteStorage.DEBUG(__DEV__);       // 启动调试信息
SQLiteStorage.enablePromise(true);  // 使用 promise(true) 或者 callback(false)

export default class SQLite {
    static delete(database) {
        return SQLiteStorage.deleteDatabase(database)
            .then(res => ({ res }))
            .catch(err => ({ err }));
    }

    constructor(databaseName, databaseVersion, databaseDisplayName, databaseSize) {
        this.databaseName = databaseName;
        this.databaseVersion = databaseVersion;
        this.databaseDisplayName = databaseDisplayName;
        this.databaseSize = databaseSize;
        this.successInfo = (text, absolutely) => {
            if (__DEV__) {
github gyxing / react-native-book / app / db / SQLite.js View on Github external
import React, { Component } from 'react'
import SQLiteStorage from 'react-native-sqlite-storage'

SQLiteStorage.DEBUG(false)
const database_name = 'reader.db'
const database_version = '1.0'
const database_displayname = 'ReaderSQLite'
const database_size = -1
let db
const Book_TABLE_NAME = 'Book' // 书架表
const Chapter_TABLE_NAME = 'Chapter' // 目录表

export default class SQLite extends Component {
  constructor() {
    super()
  }

  componentWillUnmount() {
    if (db) {
      this._successCB('close')
github andpor / react-native-sqlite-storage / test / index.ios.callback.js View on Github external
* See http://opensource.org/licenses/alphabetical for full text.
 */
'use strict';

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  ListView
} from 'react-native';


import SQLite from 'react-native-sqlite-storage';
SQLite.DEBUG(true);
SQLite.enablePromise(false);

const database_name = "Test.db";
const database_version = "1.0";
const database_displayname = "SQLite Test Database";
const database_size = 200000;
let db;

class SQLiteDemo extends Component {
  constructor() {
    super();
    this.progress = [];
    this.state = {
      progress: [],
      ds: new ListView.DataSource({
        rowHasChanged: (r1, r2) => r1 !== r2}
github andpor / react-native-sqlite-storage / test / index.ios.promise.js View on Github external
* See http://opensource.org/licenses/alphabetical for full text.
 */
'use strict';

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  ListView
} from 'react-native';


import SQLite from 'react-native-sqlite-storage';
SQLite.DEBUG(true);
SQLite.enablePromise(true);


const database_name = "Test.db";
const database_version = "1.0";
const database_displayname = "SQLite Test Database";
const database_size = 200000;
let db;

class SQLiteDemo extends Component {
  constructor() {
    super();
    this.progress = [];
    this.state = {
      progress: [],
      ds: new ListView.DataSource({
github phodal / dore / examples / webview / ExampleWebview.js View on Github external
import React, {Component} from 'react'
import {View, WebView, Dimensions} from "react-native";
import Toast from 'dore-toast';
import Orientation from 'react-native-orientation';
import RNIconBadge from 'dore-icon-badge'
import RNDeviceInfo from "react-native-device-info";
import DeviceBrightness from 'react-native-device-brightness';
import Permissions from 'react-native-permissions'
import {captureScreen} from "react-native-view-shot";
import {AppInstalledChecker} from "react-native-check-app-install";
import RNShakeEvent from 'react-native-shake-event';
import Torch from 'react-native-torch';
import SendSMS from 'react-native-sms'
import RNCalendarEvents from 'react-native-calendar-events';
import SQLite from 'react-native-sqlite-storage';
SQLite.DEBUG(true);
SQLite.enablePromise(true);
import Dore from 'dore';

let {
  height: deviceHeight,
  width: deviceWidth
} = Dimensions.get('window');

export default class ExampleWebView extends Component {
  static componentName = 'ExampleWebView';

  constructor() {
    super();
    this.state = {
      isLoading: true
    };
github MiEcosystem / miot-plugin-sdk / projects / com.xiaomi.demo / Main / ThirdPartDemo / SQLiteDemo.js View on Github external
'use strict';


import React, { Component } from 'react';
import { ListView, StyleSheet, Text, View } from 'react-native';
import SQLite from 'react-native-sqlite-storage';


SQLite.DEBUG(true);
SQLite.enablePromise(false);

const database_name = "Test.db";
const database_version = "1.0";
const database_displayname = "SQLite Test Database";
const database_size = 200000;
let db;

export default class SQLiteDemo extends Component {

  constructor() {
    super();
    this.progress = [];
    this.state = {
      progress: [],
      ds: new ListView.DataSource({

react-native-sqlite-storage

SQLite3 bindings for React Native (Android & iOS)

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis