@@ -2981,6 +2981,17 @@ void cloudsync_commit_alter (sqlite3_context *context, int argc, sqlite3_value *
29812981 }
29822982}
29832983
2984+ // MARK: -
2985+
2986+ void cloudsync_uuid (sqlite3_context * context , int argc , sqlite3_value * * argv ) {
2987+ DEBUG_FUNCTION ("cloudsync_uuid" );
2988+
2989+ char value [UUID_STR_MAXLEN ];
2990+ char * uuid = cloudsync_uuid_v7_string (value , true);
2991+ sqlite3_result_text (context , uuid , -1 , SQLITE_TRANSIENT );
2992+ }
2993+
2994+
29842995// MARK: - Main Entrypoint -
29852996
29862997APIEXPORT int sqlite3_cloudsync_init (sqlite3 * db , char * * pzErrMsg , const sqlite3_api_routines * pApi ) {
@@ -3091,6 +3102,9 @@ APIEXPORT int sqlite3_cloudsync_init (sqlite3 *db, char **pzErrMsg, const sqlite
30913102 rc = dbutils_register_function (db , "cloudsync_commit_alter" , cloudsync_commit_alter , 1 , pzErrMsg , ctx , NULL );
30923103 if (rc != SQLITE_OK ) return rc ;
30933104
3105+ rc = dbutils_register_function (db , "cloudsync_uuid" , cloudsync_uuid , 0 , pzErrMsg , ctx , NULL );
3106+ if (rc != SQLITE_OK ) return rc ;
3107+
30943108 // NETWORK LAYER
30953109 #ifndef CLOUDSYNC_OMIT_NETWORK
30963110 rc = cloudsync_network_register (db , pzErrMsg , ctx );
0 commit comments