Repository navigation
feat: add support for dynamically pathed dbs - #77
Conversation
|
@velocitysystems Can you review this? |
|
Looking at CI failures presently |
05ef767 to
a9462f6
Compare
a9462f6 to
6fece8d
Compare
@velocitysystems Looks like the |
Fixed by #78. |
d058044 to
f173dbf
Compare
|
@onehumandev Cargo Deny issue has been resolved. Can you please rebase? |
f173dbf to
77a31b2
Compare
Rebased 👍 |
77a31b2 to
fec2668
Compare
fec2668 to
d3a3f54
Compare
Until now, we have required db paths to be constant for the lifetime of an app to be accessed by a db key string. This now needs to be modified to support paths that may change during runtime. For example, if we have profile-specific dbs in an app, and the user is allowed to switch profiles during runtime, we want the key to that db to remain the same, while allowing the actual path to change to the requested db.
d3a3f54 to
fdeb6d0
Compare
|
|
||
| let _registration_lock = registered.registration_lock.lock().await; | ||
|
|
||
| if migration_is_unsettled(&migration_states, db_key).await { |
There was a problem hiding this comment.
🔵 P3 (non-blocking follow-up) — Return the migration error when this key is Failed under the lock
Non-blocking. Under the lock, a Failed state passes this check, and connect_to_database_locked no longer checks migrations. So a connect that queued behind a Replace whose new migration fails can load that database and return Ok. Add await_migrations(&migration_states, db_key).await?; after this block. The state is settled here and only register_database changes it under this lock, so the call returns at once and maps Failed to the error. Then update the comment below, which says not to call it here.
Comment added by AI model Claude
There was a problem hiding this comment.
@onehumandev Can you please evaluate whether this is worth doing as a follow-up? Thanks!
Until now, we have required db paths to be constant for the lifetime of an app to be accessed by a db key string.
This now needs to be modified to support paths that may change during runtime.
For example, if we have profile-specific dbs in an app, and the user is allowed to switch profiles during runtime, we want the key to that db to remain the same, while allowing the actual path to change to the requested db.