Giter Site home page Giter Site logo

Comments (6)

yaronyg avatar yaronyg commented on August 22, 2024

This will go out as part of story 0

from postcardapp.

deadlyfingers avatar deadlyfingers commented on August 22, 2024

*Story_001

from postcardapp.

deadlyfingers avatar deadlyfingers commented on August 22, 2024

2 options here:

  1. Destroy the db
  2. Delete all docs (but keep the db)

Option 1 is superior in terms of clearing out the app data, but then we have the problem to recreate the db - is there an easy way to restart app.js? However relaunching the app at this point might be ok for development purposes, as this button will be hidden from normal users.

Option 2 . Superior in terms of replication - changes. I'm sure there is a batch delete but just can't find the documentation on this procedure atm.

from postcardapp.

yaronyg avatar yaronyg commented on August 22, 2024

I probably would shy away from deleting all the docs because that leaves a ton of tomb stones so you really aren't in a clean state. And unfortunately PouchDB does not support purge yet.

So I think you want to destroy the db. That is going to require, I suspect, that you take the code from here to the end and put it into a function. Then inside that function you add a path for "/selfdestruct" that is associated with calling server.close (or is it server.destroy?) and then db.destroy() and then uses nextTick to call back into the function that you refactored the code into. Then at the very end of the file, you call that function.

from postcardapp.

yaronyg avatar yaronyg commented on August 22, 2024

11/9 - This is working but needs to be tested all up.

from postcardapp.

deadlyfingers avatar deadlyfingers commented on August 22, 2024

Is available when "IS_DEBUG" option is true

from postcardapp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.