Git Product home page Git Product logo

localforage-cordova-sqlite-plugin's Introduction

localForage-cordova-sqlite-plugin

A cordova-sqlite-storage driver for localForage.

Info

There are two drivers in this repository.

  • cordova-sqlite-plugin
  • cordova-sqlite-plugin-no-support-check

The first one depends in the "checkSupport" method on the "deviceready" event of Cordova.

The second one just tells that the support is guaranteed everytime. The last was created due to a bug, that the "deviceready" event is sometimes not fired in Steroids and Ionic.

See these tickets for more information:

https://github.com/AppGyver/steroids/issues/772

ionic-team/ionic-cli#259

Requirements

  • localForage has to be loaded before this plugin
  • cordova-sqlite-storage plugin has to be loaded

Configuration

Normal

TODO

With Angular

With Angular you would first configure the localForageProvider.

It could look like this:

// Example
angular.module('<REPLACE_ME_WITH_MODULE_NAME>')
// The important part
// driver could be the single 'cordova-sqlite-plugin' or with some alternatives
// size can be defined, in this example 100mb
.config(['$localForageProvider', function($localForageProvider) {
	$localForageProvider.config({
		driver: ['asyncStorage',
			'cordova-sqlite-plugin',
			'webSQLStorage'
		],
		size: 100 * 1024 * 1024
	});
}])

// in the controller/service you could use it like this
.service('<REPLACE_ME_WITH_SERVICE_NAME>',
	function($localForage, $q) {
	  var lcReturn = {};
	  
	  lcReturn.get = function(pKey) {
		return $localForage.getItem(pKey);
	  };
		
		// other service methods..
	  
	  return lcReturn;
	
	});
	```

localforage-cordova-sqlite-plugin's People

Contributors

ecostack avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.