Skip to content
Draft
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
94ebd97
added sqlite conn to metastore, metastore new changed from sync to async
YaroslavLitvinov Oct 23, 2025
ebc781e
Merge remote-tracking branch 'origin/main' into yaro/sqlite-metastore
YaroslavLitvinov Oct 23, 2025
f551732
add patchdog workflow
YaroslavLitvinov Oct 23, 2025
0f10c4f
add workflow dispatch
YaroslavLitvinov Oct 23, 2025
5914c47
stage before merging main
YaroslavLitvinov Oct 24, 2025
0851f8b
Merge remote-tracking branch 'origin/main' into yaro/sqlite-metastore
YaroslavLitvinov Oct 24, 2025
9aa26a3
metastore tests separated from implemetation; remove utoipa::ToSchema…
YaroslavLitvinov Oct 25, 2025
ed61103
metastore api simplify
YaroslavLitvinov Oct 25, 2025
76c45c8
added ID to RwObject
YaroslavLitvinov Oct 26, 2025
dd7aed6
broken, staged
YaroslavLitvinov Oct 27, 2025
5d3f7f4
staged wip
YaroslavLitvinov Oct 28, 2025
5305557
merged
YaroslavLitvinov Oct 29, 2025
b588851
stage volumes basic ops ok
YaroslavLitvinov Oct 29, 2025
51e493c
move from iter_volumes to get_volumes
YaroslavLitvinov Oct 29, 2025
82f8e9a
volume tests fixes
YaroslavLitvinov Oct 30, 2025
47b0224
wip
YaroslavLitvinov Nov 1, 2025
145ea36
make it compilable after databases support
YaroslavLitvinov Nov 2, 2025
5f2f634
run test server in separate thread
YaroslavLitvinov Nov 3, 2025
c793523
staged
YaroslavLitvinov Nov 3, 2025
7776c57
Merge remote-tracking branch 'origin/main' into yaro/sqlite-metastore
YaroslavLitvinov Nov 3, 2025
82fe602
wip
YaroslavLitvinov Nov 4, 2025
c1433fa
before changes
YaroslavLitvinov Nov 4, 2025
5877ce7
wip
YaroslavLitvinov Nov 5, 2025
797b957
draft
YaroslavLitvinov Nov 5, 2025
2e52499
some fixes, tests failing
YaroslavLitvinov Nov 6, 2025
c8dce28
fix known metastore bugs
YaroslavLitvinov Nov 6, 2025
f839468
lint
YaroslavLitvinov Nov 6, 2025
e337143
fmt
YaroslavLitvinov Nov 6, 2025
dbd70da
merged with main
YaroslavLitvinov Nov 6, 2025
1bd415d
Merge remote-tracking branch 'origin' into yaro/sqlite-metastore
YaroslavLitvinov Nov 6, 2025
ea97b3e
couple of snapshots
YaroslavLitvinov Nov 6, 2025
27774f7
staged work, use ids for compile time checks
YaroslavLitvinov Nov 7, 2025
e328080
fmt
YaroslavLitvinov Nov 7, 2025
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
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
WEB_ASSETS_SOURCE_PATH = { value = "ui/dist", relative = true }
WEB_ASSETS_TARBALL_PATH = { value = "ui/dist.tar", relative = true }
LIBSQLITE3_FLAGS = """-DSQLITE_ENABLE_COLUMN_METADATA=1 \
-DSQLITE_THREADSAFE=2 \
-DSQLITE_THREADSAFE=1 \
-DSQLITE_ENABLE_LOAD_EXTENSION=1 \
-DSQLITE_ENABLE_FTS5=1 \
-DSQLITE_ENABLE_DBSTAT_VTAB=1 \
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/rustdoc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: rustdoc comments

on:
workflow_dispatch:

pull_request:
branches:
- yaro/sqlite-metastore

env:
CARGO_TERM_COLOR: always

jobs:
run_patchdog:

runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Patchdog
uses: YuraLitvinov/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
api_key_gemini: ${{ secrets.API_KEY_GEMINI }}
127 changes: 126 additions & 1 deletion Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ insta = { version = "1.42.0", features = ["json", "filters", "redactions"] }
cfg-if = { version = "1.0.3" }
rusqlite = { version = "0.37.0", features = ["blob", "trace", "bundled"] }
deadpool-sqlite = { version = "0.12.1", features = ["tracing"] }
deadpool = { version = "0.12.3" }
deadpool-diesel = { version = "0.6.1", features = ["sqlite", "tracing"] }

[patch.crates-io]
datafusion = { git = "https://github.com/Embucket/datafusion.git", rev = "832c278922863064571c0a7c5716a3ff87ce5201" }
Expand Down
5 changes: 5 additions & 0 deletions crates/api-iceberg-rest/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ impl IntoResponse for Error {
| core_metastore::Error::Serde { .. }
| core_metastore::Error::TableMetadataBuilder { .. }
| core_metastore::Error::TableObjectStoreNotFound { .. }
| core_metastore::Error::CreateDir { .. }
| core_metastore::Error::CoreSqlite { .. }
| core_metastore::Error::CreateTables { .. }
| core_metastore::Error::Deadpool { .. }
| core_metastore::Error::Diesel { .. }
| core_metastore::Error::UrlParse { .. } => http::StatusCode::INTERNAL_SERVER_ERROR,
};

Expand Down
2 changes: 1 addition & 1 deletion crates/api-iceberg-rest/src/state.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use core_metastore::metastore::Metastore;
use core_metastore::Metastore;
use std::sync::Arc;

use serde::{Deserialize, Serialize};
Expand Down
5 changes: 5 additions & 0 deletions crates/api-internal-rest/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ impl IntoResponse for Error {
| core_metastore::Error::Serde { .. }
| core_metastore::Error::TableMetadataBuilder { .. }
| core_metastore::Error::TableObjectStoreNotFound { .. }
| core_metastore::Error::CreateDir { .. }
| core_metastore::Error::CoreSqlite { .. }
| core_metastore::Error::CreateTables { .. }
| core_metastore::Error::Deadpool { .. }
| core_metastore::Error::Diesel { .. }
| core_metastore::Error::UrlParse { .. } => http::StatusCode::INTERNAL_SERVER_ERROR,
},
};
Expand Down
4 changes: 2 additions & 2 deletions crates/api-internal-rest/src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub async fn create_volume(
.context(error::CreateVolumeSnafu)?;
state
.metastore
.create_volume(&volume.ident.clone(), volume)
.create_volume(volume)
.await
.context(error::CreateVolumeSnafu)
.map(|v| Json(hide_sensitive(v)))
Expand Down Expand Up @@ -168,7 +168,7 @@ pub async fn create_database(
.context(error::CreateDatabaseSnafu)?;
state
.metastore
.create_database(&database.ident.clone(), database)
.create_database(database)
.await
.context(error::CreateDatabaseSnafu)
.map(Json)
Expand Down
2 changes: 1 addition & 1 deletion crates/api-internal-rest/src/state.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use core_history::HistoryStore;
use core_metastore::metastore::Metastore;
use core_metastore::Metastore;
use std::sync::Arc;

// Define a State struct that contains shared services or repositories
Expand Down
5 changes: 3 additions & 2 deletions crates/api-snowflake-rest/src/server/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ pub async fn abort(
request_id,
}): Json<AbortRequestBody>,
) -> Result<Json<serde_json::value::Value>> {
state
let _query_status = state
.execution_svc
.abort_query(RunningQueryId::ByRequestId(request_id, sql_text))?;
.abort_query(RunningQueryId::ByRequestId(request_id, sql_text))
.await?;
Ok(Json(serde_json::value::Value::Null))
}
9 changes: 6 additions & 3 deletions crates/api-snowflake-rest/src/server/test_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ pub async fn run_test_rest_api_server(data_format: &str) -> SocketAddr {
let app_cfg = Config::new(data_format)
.expect("Failed to create server config")
.with_demo_credentials("embucket".to_string(), "embucket".to_string());

run_test_rest_api_server_with_config(app_cfg, UtilsConfig::default()).await
let exec_cfg = UtilsConfig::default()
.with_max_concurrency_level(2);
run_test_rest_api_server_with_config(app_cfg, exec_cfg).await
}

#[allow(clippy::unwrap_used, clippy::expect_used)]
Expand All @@ -39,13 +40,15 @@ pub async fn run_test_rest_api_server_with_config(
.with_line_number(true)
.with_span_events(FmtSpan::NONE)
.with_level(true)
.with_max_level(tracing_subscriber::filter::LevelFilter::DEBUG)
.with_max_level(tracing_subscriber::filter::LevelFilter::TRACE)
.finish();

// ignoring error: as with parralel tests execution, just first thread is able to set it successfully
// since all tests run in a single process
let _ = tracing::subscriber::set_global_default(subscriber);

tracing::info!("Starting server at {}", addr);

let metastore = SlateDBMetastore::new_in_memory().await;
let history = SlateDBHistoryStore::new_in_memory().await;

Expand Down
1 change: 1 addition & 0 deletions crates/api-snowflake-rest/src/tests/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub async fn http_req_with_headers<T: serde::de::DeserializeOwned>(
url: &String,
payload: String,
) -> Result<(HeaderMap, T), TestHttpError> {
tracing::trace!("Request: {method} {url}");
let res = client
.request(method.clone(), url)
.headers(headers)
Expand Down
3 changes: 2 additions & 1 deletion crates/api-snowflake-rest/src/tests/test_requests_abort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ mod tests {
let mut results = Vec::new();
// start retry_count from 1, to ensure it works with any retry_count as well
for retry_count in 1_u16..20_u16 {
tokio::time::sleep(Duration::from_millis(100)).await;
let result = query::<JsonResponse>(
&query_client,
&addr,
Expand All @@ -116,7 +117,7 @@ mod tests {
false,
)
.await;
eprintln!("Retry count: {}, Result: {}", retry_count, result.is_ok());
eprintln!("Retry count: {}, Result: {:?}", retry_count, result);
if result.is_ok() {
results.push(result);
break;
Expand Down
2 changes: 1 addition & 1 deletion crates/api-ui/src/tests/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ async fn test_ui_async_query_infer_default_exec_mode() {
.await
.expect_err("Get query error");

std::thread::sleep(std::time::Duration::from_millis(1000));
tokio::time::sleep(std::time::Duration::from_millis(1000)).await;

let QueryGetResponse(query_record) = http_req::<QueryGetResponse>(
&client,
Expand Down
Loading
Loading