Skip to content

Commit

Permalink
feat: improve crate structure and macros (#79)
Browse files Browse the repository at this point in the history
* feat: generate object conversions

* refactor: move Object to common and provide more convenience impls

* chore: cleanup traits

* refactor: move more conversions to derive macro

* refactor: move requesst impls to api module

* refactor: implement request action in macro

* feat: fully features catalog handler

* test: credentials handler

* chore: format
  • Loading branch information
roeap authored Feb 23, 2025
1 parent f2a3c3c commit e9107c4
Show file tree
Hide file tree
Showing 46 changed files with 2,086 additions and 1,380 deletions.
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions delta-sharing/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,31 @@ async fn get_db_handler() -> Result<ServerHandler> {
let db_url = std::env::var("DATABASE_URL")
.map_err(|_| Error::Generic("missing DATABASE_URL".to_string()))?;
let store = Arc::new(GraphStore::connect(&db_url).await.unwrap());
let policy = Arc::new(ConstantPolicy::default());
store.migrate().await.unwrap();
let handler = ServerHandler {
query: KernelQueryHandler::new_multi_thread(store.clone(), Default::default()),
query: KernelQueryHandler::new_multi_thread(
store.clone(),
Default::default(),
policy.clone(),
),
store,
policy: Arc::new(ConstantPolicy::default()),
policy,
};
Ok(handler)
}

fn get_memory_handler() -> ServerHandler {
let store = Arc::new(InMemoryResourceStore::new());
let policy = Arc::new(ConstantPolicy::default());
ServerHandler {
query: KernelQueryHandler::new_multi_thread(store.clone(), Default::default()),
query: KernelQueryHandler::new_multi_thread(
store.clone(),
Default::default(),
policy.clone(),
),
store,
policy: Arc::new(ConstantPolicy::default()),
policy,
}
}

Expand Down
29 changes: 27 additions & 2 deletions delta-sharing/client/src/gen/delta_sharing.credentials.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,21 @@ pub struct StorageLocation {
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag="7")]
pub properties: ::core::option::Option<::pbjson_types::Struct>,
/// Username of current owner of storage location.
#[prost(string, optional, tag="8")]
pub owner: ::core::option::Option<::prost::alloc::string::String>,
/// Time at which this storage location was created, in epoch milliseconds.
#[prost(int64, optional, tag="9")]
pub create_at: ::core::option::Option<i64>,
/// Username of storage location creator.
#[prost(string, optional, tag="10")]
pub created_by: ::core::option::Option<::prost::alloc::string::String>,
/// Time at which this storage location was last updated, in epoch milliseconds.
#[prost(int64, optional, tag="11")]
pub update_at: ::core::option::Option<i64>,
/// Username of user who last modified storage location.
#[prost(string, optional, tag="12")]
pub updated_by: ::core::option::Option<::prost::alloc::string::String>,
}
/// The type of storage service to use.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
Expand Down Expand Up @@ -172,8 +187,18 @@ pub struct GetCredentialRequest {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateStorageLocationRequest {
/// Storage location to create.
#[prost(message, optional, tag="1")]
pub location: ::core::option::Option<StorageLocation>,
#[prost(string, tag="2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub url: ::prost::alloc::string::String,
#[prost(enumeration="StorageType", tag="4")]
pub r#type: i32,
#[prost(string, tag="5")]
pub credential: ::prost::alloc::string::String,
#[prost(string, optional, tag="6")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag="7")]
pub properties: ::core::option::Option<::pbjson_types::Struct>,
}
/// Delete a storage location
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down
Loading

0 comments on commit e9107c4

Please sign in to comment.