CartoDB-SQL-API
CartoDB-SQL-API copied to clipboard
SQL (dump) output format
Another kind of output format should be an SQL dump.
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
I'm working on an import for SQL, it'll be pretty useless if there's no exporter O=)
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.
Being a new support this should go in 1.6. Will use a feature/sql-export branch for this
it looks like ogr2ogr supports a "PGDump" format, this is good news as we already have all the infrastructure ready for any ogr2ogr output
This is ready for test here: https://github.com/CartoDB/CartoDB-SQL-API/tree/feature/sql-export
@lorenzoplanas how's the importer going ? anything you think should be changed in the exporter ?
@lorenzoplanas any news on this ?
Any updates on this? This would really be an essential feature for what we're working on. Thanks!
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:
+1 for exporting pg_dump. Can't (internally) sell cartodb as a primary solution without ability to later migrate away if need be.
Note that latest GDAL version supports cartodb via SQL-API, so you should be able to migrate away with ogr2ogr (confirmation welcome).
@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