jeep-sqlite
Advanced tools
Comparing version 0.0.1-beta.2 to 0.0.1-beta.3
import { Component, Method } from '@stencil/core'; | ||
import { Database } from '../../utils/database'; | ||
import localForage from 'localforage'; | ||
import { databaseList } from '../../assets/databases/databases.json'; | ||
import { isJsonSQLite } from '../../utils/utils-json'; | ||
@@ -332,2 +331,4 @@ import { saveDBToStore } from '../../utils/utils-store'; | ||
this.isStore = await this.openStore("jeepSqliteStore", "databases"); | ||
const res = await this.loadJSON('assets/databases/databases.json'); | ||
this.databaseList = JSON.parse(res).databaseList; | ||
} | ||
@@ -629,3 +630,3 @@ componentDidLoad() { | ||
try { | ||
for (const dbName of databaseList) { | ||
for (const dbName of this.databaseList) { | ||
await this.copyDatabase(`assets/databases/${dbName}`); | ||
@@ -659,2 +660,19 @@ } | ||
} | ||
async loadJSON(jsonFileName) { | ||
return new Promise((resolve, reject) => { | ||
var xobj = new XMLHttpRequest(); | ||
xobj.overrideMimeType("application/json"); | ||
xobj.open('GET', jsonFileName, true); | ||
xobj.onerror = () => { | ||
reject(`LoadJSON: failed`); | ||
}; | ||
xobj.onreadystatechange = function () { | ||
if (xobj.readyState == 4 && xobj.status == 200) { | ||
// Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode | ||
resolve(xobj.responseText); | ||
} | ||
}; | ||
xobj.send(null); | ||
}); | ||
} | ||
async openStore(dbName, tableName) { | ||
@@ -661,0 +679,0 @@ let ret = false; |
@@ -1,1 +0,1 @@ | ||
import{p as e,b as s}from"./p-0238e775.js";(()=>{const s=import.meta.url,t={};return""!==s&&(t.resourcesUrl=new URL(".",s).href),e(t)})().then((e=>s([["p-f0b5e03b",[[1,"jeep-sqlite",{echo:[64],createConnection:[64],closeConnection:[64],open:[64],close:[64],execute:[64],executeSet:[64],run:[64],query:[64],isDBExists:[64],isDBOpen:[64],deleteDatabase:[64],isStoreOpen:[64],copyFromAssets:[64],isTableExists:[64],createSyncTable:[64],getSyncDate:[64],setSyncDate:[64],isJsonValid:[64],importFromJson:[64],exportToJson:[64]}]]]],e))); | ||
import{p as e,b as s}from"./p-0238e775.js";(()=>{const s=import.meta.url,t={};return""!==s&&(t.resourcesUrl=new URL(".",s).href),e(t)})().then((e=>s([["p-27b4daa8",[[1,"jeep-sqlite",{echo:[64],createConnection:[64],closeConnection:[64],open:[64],close:[64],execute:[64],executeSet:[64],run:[64],query:[64],isDBExists:[64],isDBOpen:[64],deleteDatabase:[64],isStoreOpen:[64],copyFromAssets:[64],isTableExists:[64],createSyncTable:[64],getSyncDate:[64],setSyncDate:[64],isJsonValid:[64],importFromJson:[64],exportToJson:[64]}]]]],e))); |
@@ -28,2 +28,3 @@ import { ConnectionOptions, SQLiteOptions, SQLiteExecuteOptions, SQLiteQueryOptions, SQLiteRunOptions, SQLiteSetOptions, SQLiteTableOptions, SQLiteSyncDateOptions, SQLiteImportOptions, SQLiteExportOptions, EchoResult, SQLiteChanges, SQLiteResult, SQLiteValues, SQLiteSyncDate, SQLiteJson } from '../../interfaces/interfaces'; | ||
private _dbDict; | ||
private databaseList; | ||
componentWillLoad(): Promise<void>; | ||
@@ -51,2 +52,3 @@ componentDidLoad(): void; | ||
private copyDatabase; | ||
private loadJSON; | ||
private openStore; | ||
@@ -53,0 +55,0 @@ private setConfig; |
{ | ||
"name": "jeep-sqlite", | ||
"version": "0.0.1-beta.2", | ||
"version": "0.0.1-beta.3", | ||
"description": "Browser SQLite Stencil Component", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1367119
28994