surrealdb / surrealdb.js

SurrealDB SDK for JavaScript
https://surrealdb.com
Apache License 2.0
298 stars 48 forks source link

Feature: Add backup() and restore() methods #127

Open ntorrey opened 1 year ago

ntorrey commented 1 year ago

This is kind of related to https://github.com/surrealdb/surrealdb/issues/30#issue-1335459899

It would be great if there were a backup() and restore() method in the js library. Since I use firebase functions to run CRON jobs and other tasks against my surrealdb instance, it would be nice to also be able to schedule regular backups from there as well. The backup() method would simply return the .surql file and the restore() method would... restore it. It would also be super-helpful for backing-up/restoring from a front end environment (like an administration dashboard, etc.)

kearfy commented 1 year ago

Hi @ntorrey, this feature is not yet implemented in the WebSocket protocol just yet, so we won't be implementing this just yet. I will leave this issue open however for when this does become an option!

ntorrey commented 1 year ago

Silly me - this functionality is already possible for me using the /export and /import REST endpoints! Not sure why I didn't think of this before. In any case, I think this feature would still be useful. If anyone else is using firebase functions and wants to know how I scheduled regular backups and got imports working, just ping me.