diff --git a/libs/jwst-codec-utils/bin/doc_merger.rs b/libs/jwst-codec-utils/bin/doc_merger.rs index 806fdead..834fdaff 100644 --- a/libs/jwst-codec-utils/bin/doc_merger.rs +++ b/libs/jwst-codec-utils/bin/doc_merger.rs @@ -6,7 +6,7 @@ use std::{ }; use clap::Parser; -use y_octo::Doc; +use jwst_codec::Doc; /// ybinary merger #[derive(Parser, Debug)] diff --git a/libs/jwst-codec/benches/apply_benchmarks.rs b/libs/jwst-codec/benches/apply_benchmarks.rs index ad14159c..03750155 100644 --- a/libs/jwst-codec/benches/apply_benchmarks.rs +++ b/libs/jwst-codec/benches/apply_benchmarks.rs @@ -19,7 +19,7 @@ fn apply(c: &mut Criterion) { &file.content, |b, content| { b.iter(|| { - use y_octo::*; + use jwst_codec::*; let mut doc = Doc::new(); doc.apply_update_from_binary_v1(content.clone()).unwrap() }); diff --git a/libs/jwst-codec/src/doc/awareness.rs b/libs/jwst-codec/src/doc/awareness.rs index 96cfc104..a4f8680f 100644 --- a/libs/jwst-codec/src/doc/awareness.rs +++ b/libs/jwst-codec/src/doc/awareness.rs @@ -3,9 +3,11 @@ use std::{cmp::max, collections::hash_map::Entry}; use super::*; use crate::sync::Arc; +type AwarenessCallback = dyn Fn(&Awareness, AwarenessEvent) + Send + Sync + 'static; + pub struct Awareness { awareness: AwarenessStates, - callback: Option>, + callback: Option>, local_id: u64, } diff --git a/libs/jwst-codec/src/doc/document.rs b/libs/jwst-codec/src/doc/document.rs index a180ffc2..e0175ac0 100644 --- a/libs/jwst-codec/src/doc/document.rs +++ b/libs/jwst-codec/src/doc/document.rs @@ -14,7 +14,7 @@ pub struct DocStoreStatus { /// [DocOptions] used to create a new [Doc] /// /// ``` -/// use y_octo::DocOptions; +/// use jwst_codec::DocOptions; /// /// let doc = DocOptions::new() /// .with_client_id(1) diff --git a/libs/jwst-storage/src/entities/diff_log.rs b/libs/jwst-storage/src/entities/diff_log.rs deleted file mode 100644 index a105c75b..00000000 --- a/libs/jwst-storage/src/entities/diff_log.rs +++ /dev/null @@ -1,18 +0,0 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.6 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] -#[sea_orm(table_name = "diff_log")] -pub struct Model { - #[sea_orm(primary_key)] - pub id: i32, - pub workspace: String, - pub timestamp: DateTimeWithTimeZone, - pub log: String, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation {} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/libs/jwst-storage/src/entities/mod.rs b/libs/jwst-storage/src/entities/mod.rs index 6797fce6..9eea13b5 100644 --- a/libs/jwst-storage/src/entities/mod.rs +++ b/libs/jwst-storage/src/entities/mod.rs @@ -4,6 +4,5 @@ pub mod prelude; pub mod blobs; pub mod bucket_blobs; -pub mod diff_log; pub mod docs; pub mod optimized_blobs; diff --git a/libs/jwst-storage/src/entities/prelude.rs b/libs/jwst-storage/src/entities/prelude.rs index 755a6f4d..f5578d70 100644 --- a/libs/jwst-storage/src/entities/prelude.rs +++ b/libs/jwst-storage/src/entities/prelude.rs @@ -2,6 +2,5 @@ pub use super::blobs::Entity as Blobs; pub use super::bucket_blobs::Entity as BucketBlobs; -pub use super::diff_log::Entity as DiffLog; pub use super::docs::Entity as Docs; pub use super::optimized_blobs::Entity as OptimizedBlobs; diff --git a/libs/jwst-storage/src/migration/src/lib.rs b/libs/jwst-storage/src/migration/src/lib.rs index 71ea3200..b2033151 100644 --- a/libs/jwst-storage/src/migration/src/lib.rs +++ b/libs/jwst-storage/src/migration/src/lib.rs @@ -5,7 +5,6 @@ mod m20220101_000002_initial_doc_table; mod m20230321_000001_blob_optimized_table; mod m20230614_000001_initial_bucket_blob_table; mod m20230626_023319_doc_guid; -mod m20230814_061223_initial_diff_log_table; mod m20231124_082401_blob_deleted_at; mod schemas; @@ -20,7 +19,6 @@ impl MigratorTrait for Migrator { Box::new(m20230321_000001_blob_optimized_table::Migration), Box::new(m20230614_000001_initial_bucket_blob_table::Migration), Box::new(m20230626_023319_doc_guid::Migration), - Box::new(m20230814_061223_initial_diff_log_table::Migration), Box::new(m20231124_082401_blob_deleted_at::Migration), ] } diff --git a/libs/jwst-storage/src/migration/src/m20230814_061223_initial_diff_log_table.rs b/libs/jwst-storage/src/migration/src/m20230814_061223_initial_diff_log_table.rs deleted file mode 100644 index 8662469b..00000000 --- a/libs/jwst-storage/src/migration/src/m20230814_061223_initial_diff_log_table.rs +++ /dev/null @@ -1,41 +0,0 @@ -use sea_orm_migration::prelude::*; - -#[derive(DeriveMigrationName)] -pub struct Migration; - -#[async_trait::async_trait] -impl MigrationTrait for Migration { - async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { - manager - .create_table( - Table::create() - .table(DiffLog::Table) - .if_not_exists() - .col( - ColumnDef::new(DiffLog::Id) - .integer() - .not_null() - .auto_increment() - .primary_key(), - ) - .col(ColumnDef::new(DiffLog::Workspace).string().not_null()) - .col(ColumnDef::new(DiffLog::Timestamp).timestamp_with_time_zone().not_null()) - .col(ColumnDef::new(DiffLog::Log).string().not_null()) - .to_owned(), - ) - .await - } - - async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { - manager.drop_table(Table::drop().table(DiffLog::Table).to_owned()).await - } -} - -#[derive(DeriveIden)] -enum DiffLog { - Table, - Id, - Workspace, - Timestamp, - Log, -} diff --git a/libs/jwst-storage/src/storage/docs/database.rs b/libs/jwst-storage/src/storage/docs/database.rs index 8094a883..ed12b2ec 100644 --- a/libs/jwst-storage/src/storage/docs/database.rs +++ b/libs/jwst-storage/src/storage/docs/database.rs @@ -200,7 +200,7 @@ impl DocDBStorage { } trace!("insert update: {guid}, {update_size}"); - Self::insert(conn, workspace, guid, &blob).await?; + Self::insert(conn, workspace, guid, blob).await?; trace!("end update: {guid}"); trace!("update {}bytes to {}", blob.len(), guid); @@ -358,7 +358,7 @@ impl DocStorage for DocDBStorage { let _lock = self.bucket.write().await; trace!("write_update: {:?}", data); - self.update(&self.pool, &workspace_id, &guid, data.into()).await?; + self.update(&self.pool, &workspace_id, &guid, data).await?; Ok(()) }