How to use jsstore - 10 common examples

To help you get started, we’ve selected a few jsstore examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ujjwalguptaofficial / JsStore / examples / electron / src / app / service / idb_service.js View on Github external
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);
    }
}
github ujjwalguptaofficial / JsStore / examples / react / src / service / idb_service.js View on Github external
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,
github ujjwalguptaofficial / sqlweb / examples / webpack / src / service / idb_service.js View on Github external
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);
github ujjwalguptaofficial / JsStore / examples / ts without worker / src / code / service / idb_helper.ts View on Github external
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,
github ujjwalguptaofficial / sqlweb / examples / react / src / service / idb_service.js View on Github external
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);
github ujjwalguptaofficial / sqlweb / examples / typescript / src / code / service / idb_helper.ts View on Github external
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));
github ujjwalguptaofficial / JsStore / examples / angular / my-app / src / app / service / idb.service.ts View on Github external
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
github ujjwalguptaofficial / JsStore / examples / webpack / src / service / idb_service.js View on Github external
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,
github ujjwalguptaofficial / JsStore / examples / TypeScript Example / src / code / service / idb_helper.ts View on Github external
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,
github ujjwalguptaofficial / idbstudio / src / scripts / qry_result.ts View on Github external
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 {

jsstore

Harness the power of JsStore to streamline database operations in your web applications. With its SQL-like API, JsStore simplifies IndexedDB interactions, enabling developers to easily query, filter, and manipulate data with familiar syntax and efficiency

MIT
Latest version published 19 days ago

Package Health Score

74 / 100
Full package analysis