How to use the dexie.debug function in dexie

To help you get started, we’ve selected a few dexie 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 dfahlander / Dexie.js / test / dexie-unittest-utils.js View on Github external
import Dexie from 'dexie';
import {ok, start, asyncTest} from 'QUnit';

Dexie.debug = window.location.search.indexOf('longstacks=true') !== -1 ? 'dexie' : false;
if (window.location.search.indexOf('longstacks=tests') !== -1) Dexie.debug = true; // Don't include stuff from dexie.js.

var no_optimize = window.no_optimize || window.location.search.indexOf('dontoptimize=true') !== -1;

export function resetDatabase(db) {
    /// 
    var Promise = Dexie.Promise;
    return no_optimize || !db._hasBeenCreated ?
        // Full Database recreation. Takes much time!
        db.delete().then(function () {
            return db.open().then(function() {
                if (!no_optimize) {
                    db._hasBeenCreated = true;
                    var initialState = (db._initialState = {});
                    // Now, snapshot the database how it looks like initially (what on.populate did)
                    return db.transaction('r', db.tables, function() {
                        var trans = Dexie.currentTransaction;
github dfahlander / Dexie.js / test / dexie-unittest-utils.js View on Github external
import Dexie from 'dexie';
import {ok, start, asyncTest} from 'QUnit';

Dexie.debug = window.location.search.indexOf('longstacks=true') !== -1 ? 'dexie' : false;
if (window.location.search.indexOf('longstacks=tests') !== -1) Dexie.debug = true; // Don't include stuff from dexie.js.

var no_optimize = window.no_optimize || window.location.search.indexOf('dontoptimize=true') !== -1;

export function resetDatabase(db) {
    /// 
    var Promise = Dexie.Promise;
    return no_optimize || !db._hasBeenCreated ?
        // Full Database recreation. Takes much time!
        db.delete().then(function () {
            return db.open().then(function() {
                if (!no_optimize) {
                    db._hasBeenCreated = true;
                    var initialState = (db._initialState = {});
                    // Now, snapshot the database how it looks like initially (what on.populate did)
                    return db.transaction('r', db.tables, function() {
github fakob / MoviePrint_v004 / app / utils / db.js View on Github external
import Dexie from 'dexie';
import log from 'electron-log';
// import FileObject from './fileObject';

// Force debug mode to get async stacks from exceptions.
if (process.env.NODE_ENV === 'production') {
  Dexie.debug = false;
} else {
  Dexie.debug = true; // In production, set to false to increase performance a little.
}
const imageDB = new Dexie('ImageDatabase');
imageDB.version(1).stores({
  frameList: '&frameId, fileId, frameNumber, [fileId+frameNumber]',
  // fileScanList: '&fileId',
});

const FileObject = imageDB.frameList.defineClass({
  frameId: String,
  fileId: String,
  frameNumber: Number,
  data: Blob
});
github learningequality / studio / contentcuration / contentcuration / frontend / shared / data / db.js View on Github external
import Dexie from 'dexie';
import 'dexie-observable';
import uuidv4 from 'uuid/v4';
import { APP_ID } from './constants';

if (process.env.NODE_ENV !== 'production') {
  // If not in production mode, turn Dexie's debug mode on.
  Dexie.debug = true;
}

// A UUID to distinguish this JS client from others in the same browser.
export const CLIENTID = uuidv4();

const db = new Dexie(APP_ID);

export default db;
export const { Collection } = db;
github chrahunt / TagProReplays / test / upgrade.spec.js View on Github external
var Data = require('modules/data');
var Subsystems = require('modules/subsystem');
var convert = require('modules/convert');

var jsonfile = require('jsonfile');
var $ = require('jquery');
var async = require('async');
var Dexie = require('dexie');

Dexie.debug = false;
var files = {
  1: [
    "replays1430861081332.txt"
  ]
};

function get_replays(version) {
  console.log("Getting version " + version + " replays.");
  return new Promise(function (resolve, reject) {
    async.map(files[version], function (path, callback) {
      $.ajax({
        url: "/fixtures/replays_" + version + "/" + path,
        dataType: "text" 
      }).done(function (data) {
        callback(null, {
          name: path,