feat(native): sync yocto codes (#14243)

#### PR Dependency Tree


* **PR #14243** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Batch management API for coordinated document mutations and change
tracking.
* New document accessors (IDs, state snapshots, change/delete set
queries) and subscriber count.

* **Chores**
  * Upgraded Rust edition across packages to 2024.
  * Repository-wide formatting, stylistic cleanups and test adjustments.

* **Breaking Changes**
* Removed the Node native bindings package and its JS/TS declarations
and tests (no longer published/available).

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
DarkSky
2026-01-11 06:08:33 +08:00
committed by GitHub
parent d515d295ce
commit ca2462f987
143 changed files with 1396 additions and 4841 deletions
@@ -1,6 +1,6 @@
use chrono::NaiveDateTime;
use super::{error::Result, storage::SqliteDocStorage, DocClock};
use super::{DocClock, error::Result, storage::SqliteDocStorage};
impl SqliteDocStorage {
pub async fn get_peer_remote_clocks(&self, peer: String) -> Result<Vec<DocClock>> {
@@ -15,11 +15,7 @@ impl SqliteDocStorage {
Ok(result)
}
pub async fn get_peer_remote_clock(
&self,
peer: String,
doc_id: String,
) -> Result<Option<DocClock>> {
pub async fn get_peer_remote_clock(&self, peer: String, doc_id: String) -> Result<Option<DocClock>> {
let result = sqlx::query_as!(
DocClock,
"SELECT doc_id, remote_clock as timestamp FROM peer_clocks WHERE peer = ? AND doc_id = ?",
@@ -32,12 +28,7 @@ impl SqliteDocStorage {
Ok(result)
}
pub async fn set_peer_remote_clock(
&self,
peer: String,
doc_id: String,
clock: NaiveDateTime,
) -> Result<()> {
pub async fn set_peer_remote_clock(&self, peer: String, doc_id: String, clock: NaiveDateTime) -> Result<()> {
sqlx::query(
r#"
INSERT INTO peer_clocks (peer, doc_id, remote_clock)
@@ -66,11 +57,7 @@ impl SqliteDocStorage {
Ok(result)
}
pub async fn get_peer_pulled_remote_clock(
&self,
peer: String,
doc_id: String,
) -> Result<Option<DocClock>> {
pub async fn get_peer_pulled_remote_clock(&self, peer: String, doc_id: String) -> Result<Option<DocClock>> {
let result = sqlx::query_as!(
DocClock,
r#"SELECT doc_id, pulled_remote_clock as timestamp FROM peer_clocks WHERE peer = ? AND doc_id = ?"#,
@@ -83,12 +70,7 @@ impl SqliteDocStorage {
Ok(result)
}
pub async fn set_peer_pulled_remote_clock(
&self,
peer: String,
doc_id: String,
clock: NaiveDateTime,
) -> Result<()> {
pub async fn set_peer_pulled_remote_clock(&self, peer: String, doc_id: String, clock: NaiveDateTime) -> Result<()> {
sqlx::query(
r#"
INSERT INTO peer_clocks (peer, doc_id, pulled_remote_clock)
@@ -117,11 +99,7 @@ impl SqliteDocStorage {
Ok(result)
}
pub async fn get_peer_pushed_clock(
&self,
peer: String,
doc_id: String,
) -> Result<Option<DocClock>> {
pub async fn get_peer_pushed_clock(&self, peer: String, doc_id: String) -> Result<Option<DocClock>> {
let result = sqlx::query_as!(
DocClock,
"SELECT doc_id, pushed_clock as timestamp FROM peer_clocks WHERE peer = ? AND doc_id = ?",
@@ -134,12 +112,7 @@ impl SqliteDocStorage {
Ok(result)
}
pub async fn set_peer_pushed_clock(
&self,
peer: String,
doc_id: String,
clock: NaiveDateTime,
) -> Result<()> {
pub async fn set_peer_pushed_clock(&self, peer: String, doc_id: String, clock: NaiveDateTime) -> Result<()> {
sqlx::query(
r#"
INSERT INTO peer_clocks (peer, doc_id, pushed_clock)
@@ -157,9 +130,7 @@ impl SqliteDocStorage {
}
pub async fn clear_clocks(&self) -> Result<()> {
sqlx::query("DELETE FROM peer_clocks;")
.execute(&self.pool)
.await?;
sqlx::query("DELETE FROM peer_clocks;").execute(&self.pool).await?;
Ok(())
}