diff --git a/packages/libsql-client-wasm/src/wasm.ts b/packages/libsql-client-wasm/src/wasm.ts index 240244a..37f3946 100644 --- a/packages/libsql-client-wasm/src/wasm.ts +++ b/packages/libsql-client-wasm/src/wasm.ts @@ -212,6 +212,7 @@ export class Sqlite3Client implements Client { } } + /** @deprecated sync() is deprecated and will be removed in a future release. Use `@tursodatabase/sync` instead. Learn more: https://tur.so/newsync */ async sync(): Promise { throw new LibsqlError( "sync not supported in wasm mode", diff --git a/packages/libsql-client/src/http.ts b/packages/libsql-client/src/http.ts index 72aa2c5..c2822c7 100644 --- a/packages/libsql-client/src/http.ts +++ b/packages/libsql-client/src/http.ts @@ -274,6 +274,7 @@ export class HttpClient implements Client { }); } + /** @deprecated sync() is deprecated and will be removed in a future release. Use `@tursodatabase/sync` instead. Learn more: https://tur.so/newsync */ sync(): Promise { throw new LibsqlError( "sync not supported in http mode", diff --git a/packages/libsql-client/src/sqlite3.ts b/packages/libsql-client/src/sqlite3.ts index b8a9ad8..7e1a478 100644 --- a/packages/libsql-client/src/sqlite3.ts +++ b/packages/libsql-client/src/sqlite3.ts @@ -26,6 +26,8 @@ import { export * from "@libsql/core/api"; +let _syncDeprecationWarned = false; + export function createClient(config: Config): Client { return _createClient(expandConfig(config, true)); } @@ -255,7 +257,12 @@ export class Sqlite3Client implements Client { } } + /** @deprecated sync() is deprecated and will be removed in a future release. Use `@tursodatabase/sync` instead. Learn more: https://tur.so/newsync */ async sync(): Promise { + if (!_syncDeprecationWarned) { + console.warn("libSQL: sync() is deprecated and will be removed in a future release. Use `@tursodatabase/sync` instead. Learn more: https://tur.so/newsync"); + _syncDeprecationWarned = true; + } this.#checkNotClosed(); const rep = await this.#getDb().sync(); return { diff --git a/packages/libsql-client/src/ws.ts b/packages/libsql-client/src/ws.ts index e17fbb3..0acef6b 100644 --- a/packages/libsql-client/src/ws.ts +++ b/packages/libsql-client/src/ws.ts @@ -295,6 +295,7 @@ export class WsClient implements Client { }); } + /** @deprecated sync() is deprecated and will be removed in a future release. Use `@tursodatabase/sync` instead. Learn more: https://tur.so/newsync */ sync(): Promise { throw new LibsqlError( "sync not supported in ws mode", diff --git a/packages/libsql-core/src/api.ts b/packages/libsql-core/src/api.ts index 471eb22..61db75f 100644 --- a/packages/libsql-core/src/api.ts +++ b/packages/libsql-core/src/api.ts @@ -234,6 +234,7 @@ export interface Client { */ executeMultiple(sql: string): Promise; + /** @deprecated sync() is deprecated and will be removed in a future release. Use `@tursodatabase/sync` instead. Learn more: https://tur.so/newsync */ sync(): Promise; /** Close the client and release resources.