Skip to content

polovi/react-native-sqlite-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-sqlite-helper

Promisify andpor/react-native-sqlite-storage

MyDBHelper.js

import SQLiteOpenHelper from 'react-native-sqlite-helper'

class MyDbHelper extends SQLiteOpenHelper {
  constructor() {
    super('db_name', 201);
  }

  onCreate(db) {
    console.log("create");
  }

  onUpgrade(db, oldVersion, newVersion) {
    console.log("upgrade");
  }

  onDowngrade(db, oldVersion, newVersion) {
    console.log("downgrade");
  }
}

export default MyDbHelper
import MyDBHelper from './MyDBHelper'

let dbHelper = new MyDBHelper();
let db = await this.dbHelper.getDatabase();
db.executeSql('SELECT * FROM some_table;').then((results) => {
  this.list = results.rows.raw();
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published