CartoDB-SQL-API icon indicating copy to clipboard operation
CartoDB-SQL-API copied to clipboard

SQL (dump) output format

Open strk opened this issue 12 years ago • 13 comments

Another kind of output format should be an SQL dump.

strk avatar Oct 10 '12 16:10 strk

We definitely used to offer this, even through the UI

On Wed, Oct 10, 2012 at 12:36 PM, strk [email protected] wrote:

Another kind of output format should be an SQL dump.

— Reply to this email directly or view it on GitHubhttps://github.com/Vizzuality/CartoDB-SQL-API/issues/55.

*Andrew W. Hill, Senior Scientist * www.vizzuality.com | @andrewxhill

Map, analyze and build applications with your data www.cartodb.com

andrewxhill avatar Oct 10 '12 17:10 andrewxhill

I'm working on an import for SQL, it'll be pretty useless if there's no exporter O=)

lorenzoplanas avatar Sep 05 '13 12:09 lorenzoplanas

it used to be implemented in the rails app: https://github.com/CartoDB/cartodb/blob/1.0/lib/importer/lib/cartodb-exporter/exporter.rb#L49 should be simple to port that code to sql api, as long as we can count on pg_dump being available.

strk avatar Sep 05 '13 14:09 strk

Being a new support this should go in 1.6. Will use a feature/sql-export branch for this

strk avatar Sep 05 '13 14:09 strk

it looks like ogr2ogr supports a "PGDump" format, this is good news as we already have all the infrastructure ready for any ogr2ogr output

strk avatar Sep 05 '13 14:09 strk

This is ready for test here: https://github.com/CartoDB/CartoDB-SQL-API/tree/feature/sql-export

strk avatar Sep 05 '13 15:09 strk

@lorenzoplanas how's the importer going ? anything you think should be changed in the exporter ?

strk avatar Oct 02 '13 08:10 strk

@lorenzoplanas any news on this ?

strk avatar Dec 18 '13 11:12 strk

Any updates on this? This would really be an essential feature for what we're working on. Thanks!

mnquintana avatar May 11 '15 14:05 mnquintana

There is a feature branch https://github.com/CartoDB/CartoDB-SQL-API/tree/feature/sql-export that could potentially work. Do you mind giving it a try?

However in the short term I don't see this getting into master :cry:

rochoa avatar May 11 '15 14:05 rochoa

+1 for exporting pg_dump. Can't (internally) sell cartodb as a primary solution without ability to later migrate away if need be.

bfreed avatar Aug 10 '15 19:08 bfreed

Note that latest GDAL version supports cartodb via SQL-API, so you should be able to migrate away with ogr2ogr (confirmation welcome).

strk avatar Aug 10 '15 20:08 strk

@strk I recently needed that in a project. I wrote last week a tiny Python CLI to make CartoDB backups in a SQL dump file (using ogr+pg_dump power!). It works fine. With this script (just adding a parameter) you can restore the dump file generated to a PostgreSQL/PostGIS server and test your backup (from QGIS, for example). You can use it (or modify it) as you want: https://github.com/GeographicaGS/CartoDB_Backup

cayetanobv avatar Aug 31 '15 00:08 cayetanobv