Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bindings/c/include/libsql.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,24 @@ typedef struct {
int len;
} blob;

#if defined(__GNUC__) || defined(__clang__)
#define LIBSQL_DEPRECATED(msg) __attribute__((deprecated(msg)))
#elif defined(_MSC_VER)
#define LIBSQL_DEPRECATED(msg) __declspec(deprecated(msg))
#else
#define LIBSQL_DEPRECATED(msg)
#endif

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

int libsql_enable_internal_tracing(void);

LIBSQL_DEPRECATED("sync() is deprecated and will be removed in a future release. Learn more: https://tur.so/newsync")
int libsql_sync(libsql_database_t db, const char **out_err_msg);

LIBSQL_DEPRECATED("sync() is deprecated and will be removed in a future release. Learn more: https://tur.so/newsync")
int libsql_sync2(libsql_database_t db, replicated *out_replicated, const char **out_err_msg);

int libsql_open_sync(const char *db_path,
Expand Down
3 changes: 3 additions & 0 deletions libsql/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ cfg_replication! {

/// Sync database from remote, and returns the committed frame_no after syncing, if
/// applicable.
#[deprecated(note = "sync() is deprecated and will be removed in a future release. Use the `turso` crate instead. Learn more: https://tur.so/newsync")]
pub async fn sync(&self) -> Result<Replicated> {
match &self.db_type {
#[cfg(feature = "replication")]
Expand All @@ -413,6 +414,7 @@ cfg_replication! {

/// Sync database from remote until it gets to a given replication_index or further,
/// and returns the committed frame_no after syncing, if applicable.
#[deprecated(note = "sync_until() is deprecated and will be removed in a future release. Use the `turso` crate instead. Learn more: https://tur.so/newsync")]
pub async fn sync_until(&self, replication_index: FrameNo) -> Result<Replicated> {
if let DbType::Sync { db, encryption_config: _ } = &self.db_type {
db.sync_until(replication_index).await
Expand All @@ -423,6 +425,7 @@ cfg_replication! {

/// Apply a set of frames to the database and returns the committed frame_no after syncing, if
/// applicable.
#[deprecated(note = "sync_frames() is deprecated and will be removed in a future release. Use the `turso` crate instead. Learn more: https://tur.so/newsync")]
pub async fn sync_frames(&self, frames: crate::replication::Frames) -> Result<Option<FrameNo>> {
if let DbType::Sync { db, encryption_config: _ } = &self.db_type {
db.sync_frames(frames).await
Expand Down
Loading