File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,12 @@ use crate::config::DbConfig;
3232
3333pub 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?;
Original file line number Diff line number Diff line change 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-
2220use crate :: config:: TestConfigBuilder ;
2321use assert_cmd:: Command ;
2422
You can’t perform that action at this time.
0 commit comments