Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as JsStore from "jsstore";
import {
DATA_TYPE
} from "jsstore";
import * as workerPath from 'file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.min.js';
// This will ensure that we are using only one instance.
// Otherwise due to multiple instance multiple worker will be created.
export const idbCon = new JsStore.Instance(new Worker(workerPath));
export const dbName = "students_db";
const initJsStore = async () => {
try {
const isDbCreated = await idbCon.isDbExist(dbName);
if (isDbCreated) {
idbCon.openDb(dbName);
} else {
idbCon.createDb(getDbSchema());
}
} catch (ex) {
console.error(ex);
}
}
import * as JsStore from 'jsstore';
import { IDataBase, DATA_TYPE, ITable } from 'jsstore';
const getWorkerPath = () => {
if (process.env.NODE_ENV === 'development') {
return require("file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.js");
}
else {
return require("file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.min.js");
}
};
// This will ensure that we are using only one instance.
// Otherwise due to multiple instance multiple worker will be created.
const workerPath = getWorkerPath();
export const idbCon = new JsStore.Instance(new Worker(workerPath));
export const dbname = 'Demo';
const getDatabase = () => {
const tblStudent = {
name: 'Students',
columns: {
id: {
primaryKey: true,
autoIncrement: true
},
name: {
notNull: true,
dataType: DATA_TYPE.String
},
gender: {
dataType: DATA_TYPE.String,
const getWorkerPath = () => {
if (process.env.NODE_ENV === 'development') {
return require("file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.js");
}
else {
return require("file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.min.js");
}
};
JsStore.useSqlWeb(SqlWeb);
// This will ensure that we are using only one instance.
// Otherwise due to multiple instance multiple worker will be created.
const workerPath = getWorkerPath();
const worker = new Worker(workerPath);
export const con = new JsStore.Instance(worker);
import * as JsStoreWorker from "jsstore/dist/jsstore.worker.commonjs2";
window['JsStoreWorker'] = JsStoreWorker;
import * as JsStore from 'jsstore';
import { ITable, DATA_TYPE, IDataBase } from "jsstore";
// This will ensure that we are using only one instance.
// Otherwise due to multiple instance multiple worker will be created.
export const idbCon = new JsStore.Instance();
export const dbname = 'Demo';
const getDatabase = () => {
const tblStudent: ITable = {
name: 'Students',
columns: {
id: {
primaryKey: true,
autoIncrement: true
},
name: {
notNull: true,
dataType: DATA_TYPE.String
},
gender: {
dataType: DATA_TYPE.String,
const getWorkerPath = () => {
if (process.env.NODE_ENV === 'development') {
return require("file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.js");
}
else {
return require("file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.min.js");
}
};
JsStore.useSqlWeb(SqlWeb);
// This will ensure that we are using only one instance.
// Otherwise due to multiple instance multiple worker will be created.
const workerPath = getWorkerPath();
const worker = new Worker(workerPath);
export const idbCon = new JsStore.Instance(worker);
import * as SqlWeb from 'sqlweb';
import * as JsStore from 'jsstore';
import * as workerPath from "file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.js";
JsStore.useSqlWeb(SqlWeb);
// This will ensure that we are using only one instance.
// Otherwise due to multiple instance multiple worker will be created.
export const con = new JsStore.Instance(new Worker(workerPath));
import * as JsStore from 'jsstore';
import * as workerPath from 'file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.min.js';
import { IDataBase, DATA_TYPE, ITable } from 'jsstore';
// This will ensure that we are using only one instance.
// Otherwise due to multiple instance multiple worker will be created.
export const idbCon = new JsStore.Instance(new Worker(workerPath));
export const dbname = 'Angular_Demo';
const getDatabase = () => {
const tblStudent: ITable = {
name: 'Students',
columns: {
id: {
primaryKey: true,
autoIncrement: true
},
name: {
notNull: true,
dataType: DATA_TYPE.String
import * as JsStore from 'jsstore';
import { DATA_TYPE } from 'jsstore';
const getWorkerPath = () => {
if (process.env.NODE_ENV === 'development') {
return require("file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.js");
}
else {
return require("file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.min.js");
}
};
// This will ensure that we are using only one instance.
// Otherwise due to multiple instance multiple worker will be created.
const workerPath = getWorkerPath();
export const idbCon = new JsStore.Instance(new Worker(workerPath));
export const dbname = 'Demo';
const getDatabase = () => {
const tblStudent = {
name: 'Students',
columns: {
id: {
primaryKey: true,
autoIncrement: true
},
name: {
notNull: true,
dataType: DATA_TYPE.String
},
gender: {
dataType: DATA_TYPE.String,
import * as JsStore from 'jsstore';
import { IDataBase, DATA_TYPE, ITable } from 'jsstore';
const getWorkerPath = () => {
if (process.env.NODE_ENV === 'development') {
return require("file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.js");
}
else {
return require("file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.min.js");
}
};
// This will ensure that we are using only one instance.
// Otherwise due to multiple instance multiple worker will be created.
const workerPath = getWorkerPath();
export const idbCon = new JsStore.Instance(new Worker(workerPath));
export const dbname = 'Demo';
const getDatabase = () => {
const tblStudent: ITable = {
name: 'Students',
columns: {
id: {
primaryKey: true,
autoIncrement: true
},
name: {
notNull: true,
dataType: DATA_TYPE.String
},
gender: {
dataType: DATA_TYPE.String,
printResult(qryResult: IResult) {
if (this.shouldProcess()) {
this.errorMessage = "";
var resultType = Util.getType(qryResult.result);
this.resultCount =
resultType === DATA_TYPE.Array
? qryResult.result.length
: 0;
this.timeTaken = qryResult.timeTaken.toString();
this.showResultInfo = true;
let result = qryResult.result;
switch (resultType) {
case DATA_TYPE.Array:
var rowsLength = result.length,
htmlString = "",
props: string[] = [];
for (var prop in result[0]) {
props.push(prop);
htmlString += "" + prop + "";
}
const propLength = props.length;
htmlString += "";
// var width = 100 / propLength;
for (var i = 0; i < rowsLength; i++) {
var tempHtml = "";
for (var j = 0; j < propLength; j++) {
if (result[0] && result[0][0]) {
tempHtml += "" + result[i][props[j]] + "";
} else {