Socket
Socket
Sign inDemoInstall

@capacitor-community/sqlite

Package Overview
Dependencies
Maintainers
26
Versions
242
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor-community/sqlite - npm Package Compare versions

Comparing version 2.9.10 to 2.9.11

6

CHANGELOG.md

@@ -0,1 +1,7 @@

# 2.9.11 (2021-02-15) REFACTOR
### Added Features
- isDBOpen method
# 2.9.10 (2021-02-14) REFACTOR

@@ -2,0 +8,0 @@

@@ -82,2 +82,9 @@ declare module '@capacitor/core' {

/**
* Check if a SQLite database is opened
* @param options: capSQLiteOptions
* @returns Promise<capSQLiteResult>
* @since 2.9.11
*/
isDBOpen(options: capSQLiteOptions): Promise<capSQLiteResult>;
/**
* Check if a SQLite database exists without connection

@@ -699,2 +706,9 @@ * @param options: capSQLiteOptions

/**
* Check if a SQLite database is opened
* @param options: capSQLiteOptions
* @returns Promise<capSQLiteResult>
* @since 2.9.11
*/
isDBOpen(options: capSQLiteOptions): Promise<capSQLiteResult>;
/**
* Delete a SQLite DB Connection

@@ -748,2 +762,3 @@ * @returns Promise<capSQLiteResult>

isTable(table: string): Promise<capSQLiteResult>;
isDBOpen(): Promise<capSQLiteResult>;
delete(): Promise<capSQLiteResult>;

@@ -750,0 +765,0 @@ createSyncTable(): Promise<capSQLiteChanges>;

@@ -238,2 +238,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

}
isDBOpen() {
return __awaiter(this, void 0, void 0, function* () {
const res = yield this.sqlite.isDBOpen({
database: this.dbName,
});
return res;
});
}
delete() {

@@ -240,0 +248,0 @@ return __awaiter(this, void 0, void 0, function* () {

1

dist/esm/web.d.ts

@@ -15,2 +15,3 @@ import { WebPlugin } from '@capacitor/core';

isDBExists(options: capSQLiteOptions): Promise<capSQLiteResult>;
isDBOpen(options: capSQLiteOptions): Promise<capSQLiteResult>;
isDatabase(options: capSQLiteOptions): Promise<capSQLiteResult>;

@@ -17,0 +18,0 @@ isTableExists(options: capSQLiteTableOptions): Promise<capSQLiteResult>;

@@ -105,2 +105,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

}
isDBOpen(options) {
return __awaiter(this, void 0, void 0, function* () {
console.log('in Web isDBOpen', options);
return Promise.resolve({
result: false,
message: `Not implemented on Web Platform`,
});
});
}
isDatabase(options) {

@@ -107,0 +116,0 @@ return __awaiter(this, void 0, void 0, function* () {

@@ -241,2 +241,10 @@ var capacitorPlugin = (function (exports, core) {

}
isDBOpen() {
return __awaiter(this, void 0, void 0, function* () {
const res = yield this.sqlite.isDBOpen({
database: this.dbName,
});
return res;
});
}
delete() {

@@ -389,2 +397,11 @@ return __awaiter(this, void 0, void 0, function* () {

}
isDBOpen(options) {
return __awaiter$1(this, void 0, void 0, function* () {
console.log('in Web isDBOpen', options);
return Promise.resolve({
result: false,
message: `Not implemented on Web Platform`,
});
});
}
isDatabase(options) {

@@ -391,0 +408,0 @@ return __awaiter$1(this, void 0, void 0, function* () {

@@ -22,2 +22,3 @@ import { WebPlugin } from '@capacitor/core';

isDBExists(options: capSQLiteOptions): Promise<capSQLiteResult>;
isDBOpen(options: capSQLiteOptions): Promise<capSQLiteResult>;
isDatabase(options: capSQLiteOptions): Promise<capSQLiteResult>;

@@ -24,0 +25,0 @@ isTableExists(options: capSQLiteTableOptions): Promise<capSQLiteResult>;

@@ -370,2 +370,24 @@ import { __awaiter } from "tslib";

}
isDBOpen(options) {
return __awaiter(this, void 0, void 0, function* () {
let keys = Object.keys(options);
if (!keys.includes('database')) {
return Promise.resolve({
result: false,
message: 'Must provide a database name',
});
}
const dbName = options.database;
keys = Object.keys(this._dbDict);
if (!keys.includes(dbName)) {
return Promise.resolve({
result: false,
message: `isDBOpen: No available connection for ${dbName}`,
});
}
const mDB = this._dbDict[dbName];
const isOpen = yield mDB.isDBOpen();
return Promise.resolve({ result: isOpen });
});
}
isDatabase(options) {

@@ -372,0 +394,0 @@ return __awaiter(this, void 0, void 0, function* () {

@@ -82,2 +82,9 @@ declare module '@capacitor/core' {

/**
* Check if a SQLite database is opened
* @param options: capSQLiteOptions
* @returns Promise<capSQLiteResult>
* @since 2.9.11
*/
isDBOpen(options: capSQLiteOptions): Promise<capSQLiteResult>;
/**
* Check if a SQLite database exists without connection

@@ -699,2 +706,9 @@ * @param options: capSQLiteOptions

/**
* Check if a SQLite database is opened
* @param options: capSQLiteOptions
* @returns Promise<capSQLiteResult>
* @since 2.9.11
*/
isDBOpen(options: capSQLiteOptions): Promise<capSQLiteResult>;
/**
* Delete a SQLite DB Connection

@@ -748,2 +762,3 @@ * @returns Promise<capSQLiteResult>

isTable(table: string): Promise<capSQLiteResult>;
isDBOpen(): Promise<capSQLiteResult>;
delete(): Promise<capSQLiteResult>;

@@ -750,0 +765,0 @@ createSyncTable(): Promise<capSQLiteChanges>;

@@ -230,2 +230,10 @@ import { __awaiter } from "tslib";

}
isDBOpen() {
return __awaiter(this, void 0, void 0, function* () {
const res = yield this.sqlite.isDBOpen({
database: this.dbName,
});
return res;
});
}
delete() {

@@ -232,0 +240,0 @@ return __awaiter(this, void 0, void 0, function* () {

@@ -395,2 +395,23 @@ import { WebPlugin } from '@capacitor/core';

}
async isDBOpen(options: capSQLiteOptions): Promise<capSQLiteResult> {
let keys = Object.keys(options);
if (!keys.includes('database')) {
return Promise.resolve({
result: false,
message: 'Must provide a database name',
});
}
const dbName: string = options.database!;
keys = Object.keys(this._dbDict);
if (!keys.includes(dbName)) {
return Promise.resolve({
result: false,
message: `isDBOpen: No available connection for ${dbName}`,
});
}
const mDB = this._dbDict[dbName];
const isOpen: boolean = await mDB.isDBOpen();
return Promise.resolve({ result: isOpen });
}
async isDatabase(options: capSQLiteOptions): Promise<capSQLiteResult> {

@@ -397,0 +418,0 @@ let keys = Object.keys(options);

2

package.json
{
"name": "@capacitor-community/sqlite",
"version": "2.9.10",
"version": "2.9.11",
"description": "Capacitor SQLite Plugin",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/capacitor-community/sqlite",

@@ -230,2 +230,3 @@ <p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p>

| copyFromAssets | ✅ | ✅ | ✅ | ✅ | ❌ |
| isDBOpen | ✅ | ✅ | ✅ | ✅ | ❌ |
| isDatabase | ✅ | ✅ | ✅ | ✅ | ❌ |

@@ -232,0 +233,0 @@ | isTableExists | ✅ | ✅ | ✅ | ✅ | ❌ |

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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