Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

qiao.indexeddb.js

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qiao.indexeddb.js

indexeddb tools

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

qiao.indexeddb.js

documentation

  1. indexeddb, https://wangdoc.com/javascript/bom/indexeddb.html

api

openDB

'use strict';

var qdb = require('qiao.indexeddb.js');

var test = async function(){
	try{
		var databaseName 	= 'db_test';
		var version 		= 1;
	
		var db = await qdb.openDB(databaseName, version);
		console.log(db);
	}catch(e){
		console.log(e);
	}
};

test();

listDB

'use strict';

var qdb = require('qiao.indexeddb.js');

var test = async function(){
	try{
		var dbs = await qdb.listDB();
		console.log(dbs);
	}catch(e){
		console.log(e);
	}
};

test();

delDB

'use strict';

var qdb = require('qiao.indexeddb.js');

var test = async function(){
	try{
		var databaseName = 'db_test';
		await qdb.delDB(databaseName);
	}catch(e){
		console.log(e);
	}
};

test();

createTable

'use strict';

var qdb = require('qiao.indexeddb.js');

var test = async function(){
	var databaseName	= 'db_test';
	var version 		= 1;
	var tables 			= [{
		name : 't_test1',
		key : 'id',
		index : {
			name : 'name',
			unique : false
		}
	},{
		name : 't_test2',
		key : 'auto',
		index : {
			name : 'email',
			unique : true
		}
	}];

	try{
		var db 	= await qdb.openDB(databaseName, version);
		var res = qdb.createTable(db, tables);
		console.log(res);
	}catch(e){
		console.log(e);
	}
};

test();

delTable

'use strict';

var qdb = require('qiao.indexeddb.js');

var test = async function(){
	try{
		var databaseName	= 'db_test';
		var version 		= 2;

		var db = await qdb.openDB(databaseName, version);
		qdb.delTable(db, 't_test2');
	}catch(e){
		console.log(e);
	}
};

test();

save

'use strict';

var qdb = require('qiao.indexeddb.js');

var test = async function(){
	try{
		var databaseName 	= 'db_test';
		var version 		= 2;
		var db 				= await qdb.openDB(databaseName, version);

		var tableName 	= 't_test1';
		var data 		= { id: 1, name: '张三', age: 24, email: 'zhangsan@example.com' };
		await qdb.save(db, tableName, data.id, data);

		data.name = '1';
		await qdb.save(db, tableName, data.id, data);
	}catch(e){
		console.log(e);
	}
};

test();

get

'use strict';

var qdb = require('qiao.indexeddb.js');

var test = async function(){
	var databaseName 	= 'db_test';
	var tableName		= 't_test1';
	var version 		= 2;

	try{
		var db 	= await qdb.openDB(databaseName, version);
		var s 	= await qdb.get(db, tableName, 1);
		console.log(s);
	}catch(e){
		console.log(e);
	}
};

test();

del

'use strict';

var qdb = require('qiao.indexeddb.js');

var test = async function(){
	var databaseName 	= 'db_test';
	var tableName		= 't_test1';
	var version 		= 2;

	try{
		var db = await qdb.openDB(databaseName, version);
		await qdb.del(db, tableName, 2);
	}catch(e){
		console.log(e);
	}
};

test();

clear

'use strict';

var qdb = require('qiao.indexeddb.js');

var test = async function(){
	var databaseName 	= 'db_test';
	var tableName		= 't_test1';
	var version 		= 2;

	try{
		var db = await qdb.openDB(databaseName, version);
		await qdb.clear(db, tableName);
	}catch(e){
		console.log(e);
	}
};

test();

version

0.0.7.20201023

  1. export sync
  2. save key

0.0.6.20200731

  1. add sync
  2. clear sync
  3. del db sync
  4. del sync
  5. get sync
  6. list db sync
  7. put sync
  8. save sync

0.0.5.20200630

  1. list db
  2. ncu

0.0.4.20200609

  1. del log

0.0.3.20200515

  1. tx --> db
  2. indexeddb add sync

0.0.2.20200514

  1. open db
  2. del db
  3. create table
  4. del table
  5. get data
  6. add data
  7. put data
  8. del data
  9. clear data
  10. add readme
  11. save data

0.0.1.20200513

  1. init project

Keywords

FAQs

Package last updated on 23 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc