Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app Fix paused stream (DB socket) after copy to #590 Sep 17, 2018
batch reopenFileStreams to parent class Jun 18, 2018
client Add arraybuffer format May 28, 2013
config/environments Set the default copy_from_max_post_size to 2 GB Jul 26, 2018
doc Modify python code example to really stream data Aug 2, 2018
logs updated gitignore and added required directories for node cluster to … Sep 5, 2011
test Add a test to reproduce the issue w/ COPY TO #590 Sep 17, 2018
tools Allow specifying api key via CDBSQL_APIKEY env variable Jul 17, 2013
.gitignore Ignore log and yarn.lock Jun 4, 2018
.jshintignore Format files split into pg and ogr directories May 13, 2015
.jshintrc Allow es6 syntax Aug 4, 2017
.travis.yml back previous commit Aug 16, 2018 Fixed wrong contributing url Jan 25, 2017
HOWTO_RELEASE Fixed unit test for job queue and moved isJobFound function as privat… Jan 22, 2016
LICENSE Adds notes about contributing Sep 8, 2015
Makefile Priority for tests instead of lint Dec 19, 2016 Stub next version Sep 18, 2018 Update core requirements Aug 11, 2017
app.js data ingestion logger reopenFileStreams Jun 18, 2018
carto-package.json PostGIS uses 4 numbers for versions Aug 17, 2018
npm-shrinkwrap.json add mkdirp Aug 30, 2018
package.json Stub next version Sep 18, 2018


Build Status

Provides a node.js based API for running SQL queries against CartoDB.

  • Users are authenticated over OAuth or via an API KEY.
  • Authenticated requests to this API should always be made over SSL.

core requirements

  • Postgres 9.3+.
  • Postgis 2.2.
  • CartoDB Postgres Extension 0.19+.
  • GDAL 1.11.0 (bin utils). See installing GDAL
  • zip commandline tool.
  • Redis 3, recommended reversion 3.0.2.
  • Node.js 6, recommended reversion 6.9.2.
  • npm 3, recommended version 3.10.9.

Install dependencies

npm install


Create and edit config/environments/.js from .js.example files. You may find the ./configure script useful to make an edited copy for you, see ./configure --help for a list of supported switches.

Make sure redis is running and knows about active cartodb user.

Make sure your PostgreSQL server is running, is accessible on the host and port specified in the file, has a 'publicuser' role (or whatever you set db_pubuser configuration directive to) and trusts user authentication from localhost connections.

node app.js <environment>

Supported values are development, test, production

See doc/ for API documentation. For examples of use, see under test/.


Run with:

npm test

If any issue arise see test/

Note that the environment should be set to ensure the default PostgreSQL user is superuser (PGUSER=postgres make check).