Conversation
web/server/api/endpoints/files.py
Outdated
There was a problem hiding this comment.
What about formatting content instead of the file? Also, do we want to format when renaming a file? Users might not expect that.
web/server/api/endpoints/files.py
Outdated
There was a problem hiding this comment.
Settings wouldn't have changed, right?
| path_or_new_path_mapping = await get_path_mapping(settings=get_settings()) | |
| path_or_new_path_mapping = await get_path_mapping(settings=settings) |
c7be92b to
56789db
Compare
|
@vchan |
56789db to
8e56565
Compare
web/server/api/endpoints/files.py
Outdated
There was a problem hiding this comment.
Should we use the model's dialect if it has a non-default dialect?
web/server/api/endpoints/files.py
Outdated
There was a problem hiding this comment.
What happens if the file isn't a sql file?
78b95ce to
7619f80
Compare
web/server/api/endpoints/files.py
Outdated
There was a problem hiding this comment.
Looking at the source code and docstring for parse(), default_dialect should be the project wide config dialect.
web/server/api/endpoints/files.py
Outdated
There was a problem hiding this comment.
If the formatting fails, should we still write the original content?
web/server/api/endpoints/files.py
Outdated
There was a problem hiding this comment.
Maybe we can update get_path_mapping to map paths to models and use it here instead of searching through all models every time user saves.
There was a problem hiding this comment.
we're using get_path_mapping not just for models but for files in general
7619f80 to
5ebcfed
Compare
web/server/api/endpoints/models.py
Outdated
There was a problem hiding this comment.
Why is this removed? Is it because the file watcher reloads the context on file changes now?
There was a problem hiding this comment.
yes, file watcher reloads the context on model or seed file changes and collecting models to send over SSE
web/server/api/endpoints/files.py
Outdated
There was a problem hiding this comment.
This can be removed or replaced with a SSE message warning the file couldn't be formatted. What do you think?
web/server/api/endpoints/files.py
Outdated
There was a problem hiding this comment.
Lines 75-78 can all go into this if block.
d03e309 to
69c63a4
Compare


No description provided.