diff --git a/cpp/bindings.cpp b/cpp/bindings.cpp index b471d3d9..098eca1f 100644 --- a/cpp/bindings.cpp +++ b/cpp/bindings.cpp @@ -131,8 +131,10 @@ void install(jsi::Runtime &rt, std::shared_ptr invoker, std::string url = options.getProperty(rt, "url").asString(rt).utf8(rt); std::string auth_token = options.getProperty(rt, "authToken").asString(rt).utf8(rt); - int sync_interval = - static_cast(options.getProperty(rt, "syncInterval").asNumber()); + int sync_interval = 0 if (options.hasProperty(rt, "syncInterval")) { + sync_interval = + static_cast(options.getProperty(rt, "syncInterval").asNumber()); + } std::string location; if (options.hasProperty(rt, "location")) { diff --git a/src/index.ts b/src/index.ts index c9fe6b8e..7f108aeb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -193,6 +193,7 @@ type OPSQLiteProxy = { authToken: string; name: string; location?: string; + syncInterval?: number; }) => DB; isSQLCipher: () => boolean; isLibsql: () => boolean;