Registry / database / postgres2cartodb

postgres2cartodb

JSON →
library3.1.0jsnpmunverified

PostgreSQL to CartoDB data migration tool. Current stable version: 3.1.0 (unreleased). Enables transferring tables from PostgreSQL into CartoDB with geometry support. Supports batch inserts, mode selection (create/replace/append), and direct uploads. Relies on PG connection credentials and CartoDB API key. Last updated in 2015; no recent activity.

npm install postgres2cartodb
INSTALL
IMPORT
SIG · POSTGRES2CARTODB
P
postgres2cartodb
databasejavascriptv3.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

convert
import { convert } from 'postgres2cartodb'
const convert = require('postgres2cartodb').convert
Package is ESM-only; named export convert.
convert
const { convert } = require('postgres2cartodb')
const convert = require('postgres2cartodb')
CommonJS destructuring required since default export does not exist.
default
import postgres2cartodb from 'postgres2cartodb'
const postgres2cartodb = require('postgres2cartodb')
Default import works for ESM, but package has no default export; this will be undefined.

Demonstrates programmatic usage with PostgreSQL and CartoDB connection configs, including error handling.

import { convert } from 'postgres2cartodb'; convert({ postgres: { connection: { database: 'mydb', host: 'localhost', port: 5432, user: 'user', password: 'pass' }, table: 'source_table', geometry: 'shape' }, cartodb: { connection: { user: process.env.CARTODB_USER ?? '', key: process.env.CARTODB_API_KEY ?? '' }, table: 'target_table' } }, function (err) { if (err) console.error(err); else console.log('Transfer complete'); });
Debug
Known issues
deprecatedPackage is unmaintained since 2015. May not work with current CartoDB API or Node.js versions.
fix
Consider using CartoDB's SQL API directly or a modern ETL tool like Pg-to-Carto.
affects: >=0.0.0
gotchaThe package uses an undocumented 'shape' default geometry field; table must contain this column.
fix
Specify 'geometry' option matching your actual geometry column name.
affects: >=0.0.0
gotchaThe CartoDB API key is passed in plaintext in configuration; ensure secure storage.
fix
Use environment variables or a secrets manager.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: convert is not a function
Default import used when package has named export.
fix
Use `import { convert } from 'postgres2cartodb'` or CommonJS destructuring.
Error: connect ECONNREFUSED ...
PostgreSQL connection details are missing or incorrect.
fix
Verify host, port, user, password, and database in config.
Error: Unauthorized
CartoDB API key is invalid or missing.
fix
Check CARTODB_USER and CARTODB_API_KEY environment variables or config file.
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
Resources
postgres2cartodb — npm install postgres2cartodb · libregistry