Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
couch2pg
Advanced tools
Readme
Library and cli for one-way replicating CouchDB databases to PostgreSQL 9.4+.
You will need to install the following:
couch2pg supports PostgreSQL 9.4 and greater. The user passed in the postgres url needs to have full creation rights on the given database.
npm install -g couch2pg
couch2pg --help
npm install --save couch2pg
var PG_URL = 'postgres://localhost:5432/db-name',
COUCHDB_URL = 'http://localhost:5984/db-name';
var couchdb = require('pouchdb')(COUCHDB_URL),
db = require('pg-promise')()(PG_URL);
var couch2pg = require('couch2pg'),
migrator = couch2pg.migrator(PG_URL),
importer = couch2pg.importer(db, couchdb);
return migrator()
.then(importer.importAll);
migrator
ensures that the named DB is ready to use, importAll
imports all docs from CouchDB into the postgres. If it's been run before against this DB it will pick up from where it left off last time.
Enjoy your tests with: npm test
.
Some environment variables that may be required for the integration tests to run correctly:
INT_PG_HOST
: postgres host, defaults to localhost
INT_PG_PORT
: postgres port, defaults to 5432
INT_PG_USER
: postgres user, defaults to none (system default). This user must be able to create databases on the given host.INT_PG_PASS
: user's password, defaults to none (system default)INT_PG_DB
: test database to use, defaults to medic-analytics-test
INT_COUCHDB_URL
: url to test couchdb, defaults to http://admin:pass@localhost:5984/medic-analytics-test
. The user must have the ability to destory and create databases on that host.You may be able to get away with not setting any of these, or only needing to set some of these depending on your development environment.
NB: the integration tests destroy and re-create the given databases each time they are run. Use test databases.
FAQs
Library and cli for one-way replicating CouchDB databases to PostgreSQL 9.4+.
The npm package couch2pg receives a total of 14 weekly downloads. As such, couch2pg popularity was classified as not popular.
We found that couch2pg demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 12 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.