-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: always fetch database list on bootstrap payload #11934
Conversation
There was this weird bug happening only when `SQLLAB_BACKEND_PERSISTENCE = False` where if no database had been selected, there would be some issue. This makes sure that the store is populated consistently with the list of database connections regardless of `SQLLAB_BACKEND_PERSISTENCE`. It also uses the DAO to fetch database and will apply the RBAC-related filters if any, the same way that the API does.
@@ -76,6 +76,19 @@ def find_by_ids(cls, model_ids: List[int]) -> List[Model]: | |||
).apply(query, None) | |||
return query.all() | |||
|
|||
@classmethod | |||
def find_all(cls) -> List[Model]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is very similar to find_by_ids
but decided to go explicit over dry. We're already pretty meta here so didn't want to add a layer to safe a few lines of code.
Codecov Report
@@ Coverage Diff @@
## master #11934 +/- ##
==========================================
- Coverage 67.64% 63.59% -4.05%
==========================================
Files 932 464 -468
Lines 45211 28532 -16679
Branches 4333 0 -4333
==========================================
- Hits 30583 18145 -12438
+ Misses 14525 10387 -4138
+ Partials 103 0 -103
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
There was this weird bug happening only when
SQLLAB_BACKEND_PERSISTENCE = False
where if no database had been selected, there would be someissue.
This makes sure that the store is populated consistently with the list
of database connections regardless of
SQLLAB_BACKEND_PERSISTENCE
. Italso uses the DAO to fetch database and will apply the RBAC-related
filters if any, the same way that the API does.
@dpgaspar @hughhhh @betodealmeida