Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements issue #6: ability to load local fs dumps on Node #7

Closed
wants to merge 1 commit into from
Closed

Conversation

jacargentina
Copy link

I had conflict with the load function already present by using pouchdb-replication-stream. So i choose to rename load as load_dump.

Also, tried to use ajax() on the local file (file:///path/to/dump.txt) but didnt work.

Hope @nolanlawson likes it? Any observation, are welcome.

…tream; add ability to load local dump fs on Node
@jacargentina
Copy link
Author

Fails are related to my adding for node. I've not expertise on this travis thing, some help on how to fix that?

@nolanlawson
Copy link
Member

There's an easier way to handle this in your own code:

var
  PouchDB = require('pouchdb'),
  replicationStream = require('pouchdb-replication-stream'),
  load = require('pouchdb-load');

PouchDB.plugin(size);
PouchDB.plugin({load_dump: load.load});
PouchDB.plugin(replicationStream.plugin);
PouchDB.adapter('writableStream', replicationStream.adapters.writableStream);

@nolanlawson
Copy link
Member

I would prefer to close this PR. I chose an unfortunate name that collides in the two plugins, but this can be solved in user code.

@jacargentina
Copy link
Author

@nolanlawson Any idea on how to make it work on node, reading with fs module the dump files? That part would be nice to have.

@nolanlawson
Copy link
Member

Did you try the file:// hack? I.e. use request to load a URL, and that URL is file:///path/to/my/file.

@jacargentina
Copy link
Author

As i posted on the original text, that doesnt works.

The error i get (which is lost on the stack, but i've debugged it) comes first from request, which throws:

Error: Invalid URI "file:///home/.../0.txt"
arguments: undefined
message: "Invalid URI "file:///home/.../0.txt""
stack: undefined
type: undefined
__proto__: Error

@nolanlawson
Copy link
Member

sorry, overlooked that. yes, we need to add an option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants