File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,17 @@ where
117117{
118118 if path_and_query. path ( ) . ends_with ( FORWARD_SLASH ) {
119119 path. push ( INDEX ) ;
120- find_file_or_not_found ( & path, SQL_EXTENSION , store) . await
120+ match find_file_or_not_found ( & path, SQL_EXTENSION , store) . await {
121+ Ok ( NotFound ) => {
122+ let target_sql = path. parent ( ) . unwrap_or_else ( || Path :: new ( "/" ) ) . join ( "_.sql" ) ;
123+ if store. contains ( & target_sql) . await ? {
124+ Ok ( Execute ( target_sql) )
125+ } else {
126+ Ok ( NotFound )
127+ }
128+ }
129+ result => result,
130+ }
121131 } else {
122132 let path_with_ext = path. with_extension ( SQL_EXTENSION ) ;
123133 match find_file ( & path_with_ext, SQL_EXTENSION , store) . await ? {
@@ -156,9 +166,7 @@ where
156166 T : FileStore ,
157167{
158168 let mut parent = path. parent ( ) ;
159- debug ! ( "Starting search for 404 or index file from: {}" , path. display( ) ) ;
160169 while let Some ( p) = parent {
161- debug ! ( "Checking parent path: {}" , p. display( ) ) ;
162170 let target_404 = p. join ( NOT_FOUND ) ;
163171 if store. contains ( & target_404) . await ? {
164172 return Ok ( CustomNotFound ( target_404) ) ;
You can’t perform that action at this time.
0 commit comments