libsql / sqld

LibSQL with extended capabilities like HTTP protocol, replication, and more.
https://libsql.org
903 stars 38 forks source link

Point in time recovery api #644

Closed Horusiath closed 1 year ago

Horusiath commented 1 year ago

This PR is build on top of #629 and reuses some of the concepts that @MarinPostma introduced there.

This PR introduced new endpoint in admin API: POST /v1/namespaces/:namespace/restore (with JSON payload: {generation: Uuid?, timestamp: DateTime?}). It works basically by reusing the existing reset capabilities, effectively working as drop local db folder => recreate it from scratch using bottomless backup up to a given point (specified as either generation or timestamp for point-in-time recovery).

Additionally it unifies chromo::DateTime implementations used in bottomless to universally use NaiveDateTime everywhere.