Skip to content

Commit 0d5d93e

Browse files
Cleanup
1 parent 48bab7a commit 0d5d93e

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/db.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ use crate::config::DbConfig;
3232

3333
pub async fn register_db(ctx: &SessionContext, db_config: &DbConfig) -> Result<()> {
3434
info!("registering tables to database");
35-
let catalogs = read_dir(db_config.path.join("tables"))?;
35+
let tables_path = db_config.path.join("tables");
36+
if !tables_path.exists() || !tables_path.is_dir() {
37+
info!("no tables directory configured, skipping table registration");
38+
return Ok(());
39+
}
40+
let catalogs = read_dir(tables_path)?;
3641
info!("...reading catalogs");
3742
for maybe_catalog in catalogs {
3843
let catalog = maybe_catalog?;

tests/cli_cases/tpch.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
//! Tests for the CLI (e.g. run from files) to make sure config works as expected
1919
20-
use std::fs::DirEntry;
21-
2220
use crate::config::TestConfigBuilder;
2321
use assert_cmd::Command;
2422

0 commit comments

Comments
 (0)