Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve crate structure and macros #79

Merged
merged 9 commits into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading