@taladb/react-native 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/jniLibs/arm64-v8a/libtaladb_ffi.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libtaladb_ffi.so +0 -0
- package/android/src/main/jniLibs/x86_64/libtaladb_ffi.so +0 -0
- package/cpp/TalaDBHostObject.cpp +69 -0
- package/cpp/taladb.h +31 -0
- package/ios/TalaDBFfi.xcframework/Info.plist +9 -9
- package/ios/TalaDBFfi.xcframework/ios-arm64/Headers/TalaDBHostObject.cpp +69 -0
- package/ios/TalaDBFfi.xcframework/ios-arm64/Headers/taladb.h +31 -0
- package/ios/TalaDBFfi.xcframework/ios-arm64/libtaladb_ffi.a +0 -0
- package/ios/TalaDBFfi.xcframework/ios-arm64_x86_64-simulator/Headers/TalaDBHostObject.cpp +69 -0
- package/ios/TalaDBFfi.xcframework/ios-arm64_x86_64-simulator/Headers/taladb.h +31 -0
- package/ios/TalaDBFfi.xcframework/ios-arm64_x86_64-simulator/libtaladb_ffi_sim.a +0 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/cpp/TalaDBHostObject.cpp
CHANGED
|
@@ -247,6 +247,9 @@ std::vector<PropNameID> TalaDBHostObject::getPropertyNames(Runtime &rt) {
|
|
|
247
247
|
"count",
|
|
248
248
|
"aggregate",
|
|
249
249
|
"exportChanges", "importChanges", "listCollectionNames",
|
|
250
|
+
"importChangesValidated", "quarantined",
|
|
251
|
+
"userVersion", "setUserVersion",
|
|
252
|
+
"flush",
|
|
250
253
|
"createIndex", "dropIndex",
|
|
251
254
|
"createCompoundIndex", "dropCompoundIndex",
|
|
252
255
|
"createFtsIndex", "dropFtsIndex",
|
|
@@ -493,6 +496,72 @@ Value TalaDBHostObject::get(Runtime &rt, const PropNameID &propName) {
|
|
|
493
496
|
});
|
|
494
497
|
}
|
|
495
498
|
|
|
499
|
+
// ------------------------------------------------------------------
|
|
500
|
+
// Validate-on-import — importChangesValidated / quarantined
|
|
501
|
+
// ------------------------------------------------------------------
|
|
502
|
+
if (name == "importChangesValidated") {
|
|
503
|
+
return Function::createFromHostFunction(
|
|
504
|
+
rt, PropNameID::forAscii(rt, "importChangesValidated"), 2,
|
|
505
|
+
[this](Runtime &rt, const Value &, const Value *args, size_t count) -> Value {
|
|
506
|
+
if (count < 2) throw JSError(rt, "importChangesValidated requires 2 arguments");
|
|
507
|
+
auto changeset = args[0].getString(rt).utf8(rt);
|
|
508
|
+
auto schemas = args[1].getString(rt).utf8(rt);
|
|
509
|
+
char *result = taladb_import_changes_validated(db_, changeset.c_str(), schemas.c_str());
|
|
510
|
+
if (!result) throw JSError(rt, "taladb_import_changes_validated failed");
|
|
511
|
+
std::string json(result);
|
|
512
|
+
taladb_free_string(result);
|
|
513
|
+
return parse(rt, json); // { applied, skipped, quarantined }
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
if (name == "quarantined") {
|
|
518
|
+
return Function::createFromHostFunction(
|
|
519
|
+
rt, PropNameID::forAscii(rt, "quarantined"), 1,
|
|
520
|
+
[this](Runtime &rt, const Value &, const Value *args, size_t count) -> Value {
|
|
521
|
+
if (count < 1) throw JSError(rt, "quarantined requires 1 argument");
|
|
522
|
+
auto col = args[0].getString(rt).utf8(rt);
|
|
523
|
+
char *result = taladb_quarantined(db_, col.c_str());
|
|
524
|
+
if (!result) throw JSError(rt, "taladb_quarantined failed");
|
|
525
|
+
std::string json(result);
|
|
526
|
+
taladb_free_string(result);
|
|
527
|
+
return parse(rt, json); // [{ document, reason, changedAt }]
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// ------------------------------------------------------------------
|
|
532
|
+
// Application migrations — userVersion / setUserVersion
|
|
533
|
+
// ------------------------------------------------------------------
|
|
534
|
+
if (name == "userVersion") {
|
|
535
|
+
return Function::createFromHostFunction(
|
|
536
|
+
rt, PropNameID::forAscii(rt, "userVersion"), 0,
|
|
537
|
+
[this](Runtime &rt, const Value &, const Value *, size_t) -> Value {
|
|
538
|
+
int64_t v = taladb_user_version(db_);
|
|
539
|
+
if (v < 0) throw JSError(rt, "taladb_user_version failed");
|
|
540
|
+
return Value(static_cast<double>(v));
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
if (name == "setUserVersion") {
|
|
545
|
+
return Function::createFromHostFunction(
|
|
546
|
+
rt, PropNameID::forAscii(rt, "setUserVersion"), 1,
|
|
547
|
+
[this](Runtime &rt, const Value &, const Value *args, size_t count) -> Value {
|
|
548
|
+
if (count < 1) throw JSError(rt, "setUserVersion requires 1 argument");
|
|
549
|
+
uint32_t version = static_cast<uint32_t>(args[0].getNumber());
|
|
550
|
+
if (taladb_set_user_version(db_, version) < 0)
|
|
551
|
+
throw JSError(rt, "taladb_set_user_version failed");
|
|
552
|
+
return Value::undefined();
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
if (name == "flush") {
|
|
557
|
+
return Function::createFromHostFunction(
|
|
558
|
+
rt, PropNameID::forAscii(rt, "flush"), 0,
|
|
559
|
+
[this](Runtime &rt, const Value &, const Value *, size_t) -> Value {
|
|
560
|
+
if (taladb_flush(db_) < 0) throw JSError(rt, "taladb_flush failed");
|
|
561
|
+
return Value::undefined();
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
|
|
496
565
|
// ------------------------------------------------------------------
|
|
497
566
|
// createIndex / dropIndex / createFtsIndex / dropFtsIndex
|
|
498
567
|
// ------------------------------------------------------------------
|
package/cpp/taladb.h
CHANGED
|
@@ -180,6 +180,37 @@ int32_t taladb_import_changes(TalaDbHandle *handle,
|
|
|
180
180
|
*/
|
|
181
181
|
char *taladb_list_collection_names(TalaDbHandle *handle);
|
|
182
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Merge a JSON changeset through a tolerant structural validator built from
|
|
185
|
+
* schemas_json ({ "<collection>": { version, required, types, defaults,
|
|
186
|
+
* renames } }). Returns a JSON "{ applied, skipped, quarantined }" string, or
|
|
187
|
+
* NULL on error. Caller must free with taladb_free_string().
|
|
188
|
+
*/
|
|
189
|
+
char *taladb_import_changes_validated(TalaDbHandle *handle,
|
|
190
|
+
const char *changeset_json,
|
|
191
|
+
const char *schemas_json);
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Documents set aside in a collection's quarantine table by a validated import,
|
|
195
|
+
* as a JSON array of { document, reason, changedAt }. NULL on error. Caller
|
|
196
|
+
* must free with taladb_free_string().
|
|
197
|
+
*/
|
|
198
|
+
char *taladb_quarantined(TalaDbHandle *handle, const char *collection);
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Read / write the application migration version (backs openDB({ migrations })).
|
|
202
|
+
* taladb_user_version returns the version (0 if unset) or -1 on error;
|
|
203
|
+
* taladb_set_user_version returns 0 on success, -1 on error.
|
|
204
|
+
*/
|
|
205
|
+
int64_t taladb_user_version(TalaDbHandle *handle);
|
|
206
|
+
int32_t taladb_set_user_version(TalaDbHandle *handle, uint32_t version);
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Force any batched (eventual-durability) writes to disk. Returns 0 on success,
|
|
210
|
+
* -1 on error. No-op under the default immediate durability. Backs db.flush().
|
|
211
|
+
*/
|
|
212
|
+
int32_t taladb_flush(TalaDbHandle *handle);
|
|
213
|
+
|
|
183
214
|
/* -------------------------------------------------------------------------
|
|
184
215
|
* Index management
|
|
185
216
|
* ---------------------------------------------------------------------- */
|
|
@@ -6,38 +6,38 @@
|
|
|
6
6
|
<array>
|
|
7
7
|
<dict>
|
|
8
8
|
<key>BinaryPath</key>
|
|
9
|
-
<string>
|
|
9
|
+
<string>libtaladb_ffi.a</string>
|
|
10
10
|
<key>HeadersPath</key>
|
|
11
11
|
<string>Headers</string>
|
|
12
12
|
<key>LibraryIdentifier</key>
|
|
13
|
-
<string>ios-
|
|
13
|
+
<string>ios-arm64</string>
|
|
14
14
|
<key>LibraryPath</key>
|
|
15
|
-
<string>
|
|
15
|
+
<string>libtaladb_ffi.a</string>
|
|
16
16
|
<key>SupportedArchitectures</key>
|
|
17
17
|
<array>
|
|
18
18
|
<string>arm64</string>
|
|
19
|
-
<string>x86_64</string>
|
|
20
19
|
</array>
|
|
21
20
|
<key>SupportedPlatform</key>
|
|
22
21
|
<string>ios</string>
|
|
23
|
-
<key>SupportedPlatformVariant</key>
|
|
24
|
-
<string>simulator</string>
|
|
25
22
|
</dict>
|
|
26
23
|
<dict>
|
|
27
24
|
<key>BinaryPath</key>
|
|
28
|
-
<string>
|
|
25
|
+
<string>libtaladb_ffi_sim.a</string>
|
|
29
26
|
<key>HeadersPath</key>
|
|
30
27
|
<string>Headers</string>
|
|
31
28
|
<key>LibraryIdentifier</key>
|
|
32
|
-
<string>ios-
|
|
29
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
33
30
|
<key>LibraryPath</key>
|
|
34
|
-
<string>
|
|
31
|
+
<string>libtaladb_ffi_sim.a</string>
|
|
35
32
|
<key>SupportedArchitectures</key>
|
|
36
33
|
<array>
|
|
37
34
|
<string>arm64</string>
|
|
35
|
+
<string>x86_64</string>
|
|
38
36
|
</array>
|
|
39
37
|
<key>SupportedPlatform</key>
|
|
40
38
|
<string>ios</string>
|
|
39
|
+
<key>SupportedPlatformVariant</key>
|
|
40
|
+
<string>simulator</string>
|
|
41
41
|
</dict>
|
|
42
42
|
</array>
|
|
43
43
|
<key>CFBundlePackageType</key>
|
|
@@ -247,6 +247,9 @@ std::vector<PropNameID> TalaDBHostObject::getPropertyNames(Runtime &rt) {
|
|
|
247
247
|
"count",
|
|
248
248
|
"aggregate",
|
|
249
249
|
"exportChanges", "importChanges", "listCollectionNames",
|
|
250
|
+
"importChangesValidated", "quarantined",
|
|
251
|
+
"userVersion", "setUserVersion",
|
|
252
|
+
"flush",
|
|
250
253
|
"createIndex", "dropIndex",
|
|
251
254
|
"createCompoundIndex", "dropCompoundIndex",
|
|
252
255
|
"createFtsIndex", "dropFtsIndex",
|
|
@@ -493,6 +496,72 @@ Value TalaDBHostObject::get(Runtime &rt, const PropNameID &propName) {
|
|
|
493
496
|
});
|
|
494
497
|
}
|
|
495
498
|
|
|
499
|
+
// ------------------------------------------------------------------
|
|
500
|
+
// Validate-on-import — importChangesValidated / quarantined
|
|
501
|
+
// ------------------------------------------------------------------
|
|
502
|
+
if (name == "importChangesValidated") {
|
|
503
|
+
return Function::createFromHostFunction(
|
|
504
|
+
rt, PropNameID::forAscii(rt, "importChangesValidated"), 2,
|
|
505
|
+
[this](Runtime &rt, const Value &, const Value *args, size_t count) -> Value {
|
|
506
|
+
if (count < 2) throw JSError(rt, "importChangesValidated requires 2 arguments");
|
|
507
|
+
auto changeset = args[0].getString(rt).utf8(rt);
|
|
508
|
+
auto schemas = args[1].getString(rt).utf8(rt);
|
|
509
|
+
char *result = taladb_import_changes_validated(db_, changeset.c_str(), schemas.c_str());
|
|
510
|
+
if (!result) throw JSError(rt, "taladb_import_changes_validated failed");
|
|
511
|
+
std::string json(result);
|
|
512
|
+
taladb_free_string(result);
|
|
513
|
+
return parse(rt, json); // { applied, skipped, quarantined }
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
if (name == "quarantined") {
|
|
518
|
+
return Function::createFromHostFunction(
|
|
519
|
+
rt, PropNameID::forAscii(rt, "quarantined"), 1,
|
|
520
|
+
[this](Runtime &rt, const Value &, const Value *args, size_t count) -> Value {
|
|
521
|
+
if (count < 1) throw JSError(rt, "quarantined requires 1 argument");
|
|
522
|
+
auto col = args[0].getString(rt).utf8(rt);
|
|
523
|
+
char *result = taladb_quarantined(db_, col.c_str());
|
|
524
|
+
if (!result) throw JSError(rt, "taladb_quarantined failed");
|
|
525
|
+
std::string json(result);
|
|
526
|
+
taladb_free_string(result);
|
|
527
|
+
return parse(rt, json); // [{ document, reason, changedAt }]
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// ------------------------------------------------------------------
|
|
532
|
+
// Application migrations — userVersion / setUserVersion
|
|
533
|
+
// ------------------------------------------------------------------
|
|
534
|
+
if (name == "userVersion") {
|
|
535
|
+
return Function::createFromHostFunction(
|
|
536
|
+
rt, PropNameID::forAscii(rt, "userVersion"), 0,
|
|
537
|
+
[this](Runtime &rt, const Value &, const Value *, size_t) -> Value {
|
|
538
|
+
int64_t v = taladb_user_version(db_);
|
|
539
|
+
if (v < 0) throw JSError(rt, "taladb_user_version failed");
|
|
540
|
+
return Value(static_cast<double>(v));
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
if (name == "setUserVersion") {
|
|
545
|
+
return Function::createFromHostFunction(
|
|
546
|
+
rt, PropNameID::forAscii(rt, "setUserVersion"), 1,
|
|
547
|
+
[this](Runtime &rt, const Value &, const Value *args, size_t count) -> Value {
|
|
548
|
+
if (count < 1) throw JSError(rt, "setUserVersion requires 1 argument");
|
|
549
|
+
uint32_t version = static_cast<uint32_t>(args[0].getNumber());
|
|
550
|
+
if (taladb_set_user_version(db_, version) < 0)
|
|
551
|
+
throw JSError(rt, "taladb_set_user_version failed");
|
|
552
|
+
return Value::undefined();
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
if (name == "flush") {
|
|
557
|
+
return Function::createFromHostFunction(
|
|
558
|
+
rt, PropNameID::forAscii(rt, "flush"), 0,
|
|
559
|
+
[this](Runtime &rt, const Value &, const Value *, size_t) -> Value {
|
|
560
|
+
if (taladb_flush(db_) < 0) throw JSError(rt, "taladb_flush failed");
|
|
561
|
+
return Value::undefined();
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
|
|
496
565
|
// ------------------------------------------------------------------
|
|
497
566
|
// createIndex / dropIndex / createFtsIndex / dropFtsIndex
|
|
498
567
|
// ------------------------------------------------------------------
|
|
@@ -180,6 +180,37 @@ int32_t taladb_import_changes(TalaDbHandle *handle,
|
|
|
180
180
|
*/
|
|
181
181
|
char *taladb_list_collection_names(TalaDbHandle *handle);
|
|
182
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Merge a JSON changeset through a tolerant structural validator built from
|
|
185
|
+
* schemas_json ({ "<collection>": { version, required, types, defaults,
|
|
186
|
+
* renames } }). Returns a JSON "{ applied, skipped, quarantined }" string, or
|
|
187
|
+
* NULL on error. Caller must free with taladb_free_string().
|
|
188
|
+
*/
|
|
189
|
+
char *taladb_import_changes_validated(TalaDbHandle *handle,
|
|
190
|
+
const char *changeset_json,
|
|
191
|
+
const char *schemas_json);
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Documents set aside in a collection's quarantine table by a validated import,
|
|
195
|
+
* as a JSON array of { document, reason, changedAt }. NULL on error. Caller
|
|
196
|
+
* must free with taladb_free_string().
|
|
197
|
+
*/
|
|
198
|
+
char *taladb_quarantined(TalaDbHandle *handle, const char *collection);
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Read / write the application migration version (backs openDB({ migrations })).
|
|
202
|
+
* taladb_user_version returns the version (0 if unset) or -1 on error;
|
|
203
|
+
* taladb_set_user_version returns 0 on success, -1 on error.
|
|
204
|
+
*/
|
|
205
|
+
int64_t taladb_user_version(TalaDbHandle *handle);
|
|
206
|
+
int32_t taladb_set_user_version(TalaDbHandle *handle, uint32_t version);
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Force any batched (eventual-durability) writes to disk. Returns 0 on success,
|
|
210
|
+
* -1 on error. No-op under the default immediate durability. Backs db.flush().
|
|
211
|
+
*/
|
|
212
|
+
int32_t taladb_flush(TalaDbHandle *handle);
|
|
213
|
+
|
|
183
214
|
/* -------------------------------------------------------------------------
|
|
184
215
|
* Index management
|
|
185
216
|
* ---------------------------------------------------------------------- */
|
|
Binary file
|
|
@@ -247,6 +247,9 @@ std::vector<PropNameID> TalaDBHostObject::getPropertyNames(Runtime &rt) {
|
|
|
247
247
|
"count",
|
|
248
248
|
"aggregate",
|
|
249
249
|
"exportChanges", "importChanges", "listCollectionNames",
|
|
250
|
+
"importChangesValidated", "quarantined",
|
|
251
|
+
"userVersion", "setUserVersion",
|
|
252
|
+
"flush",
|
|
250
253
|
"createIndex", "dropIndex",
|
|
251
254
|
"createCompoundIndex", "dropCompoundIndex",
|
|
252
255
|
"createFtsIndex", "dropFtsIndex",
|
|
@@ -493,6 +496,72 @@ Value TalaDBHostObject::get(Runtime &rt, const PropNameID &propName) {
|
|
|
493
496
|
});
|
|
494
497
|
}
|
|
495
498
|
|
|
499
|
+
// ------------------------------------------------------------------
|
|
500
|
+
// Validate-on-import — importChangesValidated / quarantined
|
|
501
|
+
// ------------------------------------------------------------------
|
|
502
|
+
if (name == "importChangesValidated") {
|
|
503
|
+
return Function::createFromHostFunction(
|
|
504
|
+
rt, PropNameID::forAscii(rt, "importChangesValidated"), 2,
|
|
505
|
+
[this](Runtime &rt, const Value &, const Value *args, size_t count) -> Value {
|
|
506
|
+
if (count < 2) throw JSError(rt, "importChangesValidated requires 2 arguments");
|
|
507
|
+
auto changeset = args[0].getString(rt).utf8(rt);
|
|
508
|
+
auto schemas = args[1].getString(rt).utf8(rt);
|
|
509
|
+
char *result = taladb_import_changes_validated(db_, changeset.c_str(), schemas.c_str());
|
|
510
|
+
if (!result) throw JSError(rt, "taladb_import_changes_validated failed");
|
|
511
|
+
std::string json(result);
|
|
512
|
+
taladb_free_string(result);
|
|
513
|
+
return parse(rt, json); // { applied, skipped, quarantined }
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
if (name == "quarantined") {
|
|
518
|
+
return Function::createFromHostFunction(
|
|
519
|
+
rt, PropNameID::forAscii(rt, "quarantined"), 1,
|
|
520
|
+
[this](Runtime &rt, const Value &, const Value *args, size_t count) -> Value {
|
|
521
|
+
if (count < 1) throw JSError(rt, "quarantined requires 1 argument");
|
|
522
|
+
auto col = args[0].getString(rt).utf8(rt);
|
|
523
|
+
char *result = taladb_quarantined(db_, col.c_str());
|
|
524
|
+
if (!result) throw JSError(rt, "taladb_quarantined failed");
|
|
525
|
+
std::string json(result);
|
|
526
|
+
taladb_free_string(result);
|
|
527
|
+
return parse(rt, json); // [{ document, reason, changedAt }]
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// ------------------------------------------------------------------
|
|
532
|
+
// Application migrations — userVersion / setUserVersion
|
|
533
|
+
// ------------------------------------------------------------------
|
|
534
|
+
if (name == "userVersion") {
|
|
535
|
+
return Function::createFromHostFunction(
|
|
536
|
+
rt, PropNameID::forAscii(rt, "userVersion"), 0,
|
|
537
|
+
[this](Runtime &rt, const Value &, const Value *, size_t) -> Value {
|
|
538
|
+
int64_t v = taladb_user_version(db_);
|
|
539
|
+
if (v < 0) throw JSError(rt, "taladb_user_version failed");
|
|
540
|
+
return Value(static_cast<double>(v));
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
if (name == "setUserVersion") {
|
|
545
|
+
return Function::createFromHostFunction(
|
|
546
|
+
rt, PropNameID::forAscii(rt, "setUserVersion"), 1,
|
|
547
|
+
[this](Runtime &rt, const Value &, const Value *args, size_t count) -> Value {
|
|
548
|
+
if (count < 1) throw JSError(rt, "setUserVersion requires 1 argument");
|
|
549
|
+
uint32_t version = static_cast<uint32_t>(args[0].getNumber());
|
|
550
|
+
if (taladb_set_user_version(db_, version) < 0)
|
|
551
|
+
throw JSError(rt, "taladb_set_user_version failed");
|
|
552
|
+
return Value::undefined();
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
if (name == "flush") {
|
|
557
|
+
return Function::createFromHostFunction(
|
|
558
|
+
rt, PropNameID::forAscii(rt, "flush"), 0,
|
|
559
|
+
[this](Runtime &rt, const Value &, const Value *, size_t) -> Value {
|
|
560
|
+
if (taladb_flush(db_) < 0) throw JSError(rt, "taladb_flush failed");
|
|
561
|
+
return Value::undefined();
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
|
|
496
565
|
// ------------------------------------------------------------------
|
|
497
566
|
// createIndex / dropIndex / createFtsIndex / dropFtsIndex
|
|
498
567
|
// ------------------------------------------------------------------
|
|
@@ -180,6 +180,37 @@ int32_t taladb_import_changes(TalaDbHandle *handle,
|
|
|
180
180
|
*/
|
|
181
181
|
char *taladb_list_collection_names(TalaDbHandle *handle);
|
|
182
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Merge a JSON changeset through a tolerant structural validator built from
|
|
185
|
+
* schemas_json ({ "<collection>": { version, required, types, defaults,
|
|
186
|
+
* renames } }). Returns a JSON "{ applied, skipped, quarantined }" string, or
|
|
187
|
+
* NULL on error. Caller must free with taladb_free_string().
|
|
188
|
+
*/
|
|
189
|
+
char *taladb_import_changes_validated(TalaDbHandle *handle,
|
|
190
|
+
const char *changeset_json,
|
|
191
|
+
const char *schemas_json);
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Documents set aside in a collection's quarantine table by a validated import,
|
|
195
|
+
* as a JSON array of { document, reason, changedAt }. NULL on error. Caller
|
|
196
|
+
* must free with taladb_free_string().
|
|
197
|
+
*/
|
|
198
|
+
char *taladb_quarantined(TalaDbHandle *handle, const char *collection);
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Read / write the application migration version (backs openDB({ migrations })).
|
|
202
|
+
* taladb_user_version returns the version (0 if unset) or -1 on error;
|
|
203
|
+
* taladb_set_user_version returns 0 on success, -1 on error.
|
|
204
|
+
*/
|
|
205
|
+
int64_t taladb_user_version(TalaDbHandle *handle);
|
|
206
|
+
int32_t taladb_set_user_version(TalaDbHandle *handle, uint32_t version);
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Force any batched (eventual-durability) writes to disk. Returns 0 on success,
|
|
210
|
+
* -1 on error. No-op under the default immediate durability. Backs db.flush().
|
|
211
|
+
*/
|
|
212
|
+
int32_t taladb_flush(TalaDbHandle *handle);
|
|
213
|
+
|
|
183
214
|
/* -------------------------------------------------------------------------
|
|
184
215
|
* Index management
|
|
185
216
|
* ---------------------------------------------------------------------- */
|
|
Binary file
|