Skip to content

feat(mobile): sqlite #16861

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

Merged
merged 8 commits into from
Apr 2, 2025
Merged

feat(mobile): sqlite #16861

merged 8 commits into from
Apr 2, 2025

Conversation

shenlong-tanwen
Copy link
Member

Description

  • Added Drift for Sqlite
  • Added User, User Metadata and Partner entities in Drift

@shenlong-tanwen shenlong-tanwen marked this pull request as ready for review March 15, 2025 14:17
@shenlong-tanwen shenlong-tanwen force-pushed the refactor/remove-user-id branch from 343fce0 to 9366699 Compare March 18, 2025 13:34
Base automatically changed from refactor/remove-user-id to main March 18, 2025 16:05
@mertalev
Copy link
Contributor

mertalev commented Mar 28, 2025

Also, we probably want STRICT, WAL mode and WITHOUT ROWID enabled for all tables for sanity.

@shenlong-tanwen
Copy link
Member Author

A small heads-up, in the last commit, I've moved the common Drift table overrides to a mixin and applied it to all three drift entities. This should make it easier to apply them for the newer entities.

@alextran1502 alextran1502 merged commit 5a456ef into main Apr 2, 2025
44 checks passed
@alextran1502 alextran1502 deleted the feat/sqlite branch April 2, 2025 13:58
kirill-dev-pro pushed a commit to kirill-dev-pro/immich-but-with-public-albums-within-instance that referenced this pull request Apr 6, 2025
* refactor: user entity

* chore: rebase fixes

* refactor: remove int user Id

* refactor: migrate store userId from int to string

* refactor: rename uid to id

* feat: drift

* pr feedback

* refactor: move common overrides to mixin

---------

Co-authored-by: shenlong-tanwen <[email protected]>
@akostadinov
Copy link

Does this apply to the iphone app? Sorry I don't use iphone so asking if I should advise my users.

@shenlong-tanwen
Copy link
Member Author

Does this apply to the iphone app? Sorry I don't use iphone so asking if I should advise my users.

Are you sure this comment is meant for this PR? Either ways, we are in the process of migrating our local database from Isar to Sqlite and is common for both Android and iOS

@akostadinov
Copy link

I was asking in reference to the release notes of v1.132.0 where it is stated that a switch to sqlite was made. As well in reference to #13369 that presently the iPhone app is very slow.

So the question was whether this switch to sqlite is supposed to improve iphone mobile app scalability or this is not expected to affect it.

@shenlong-tanwen
Copy link
Member Author

I was asking in reference to the release notes of v1.132.0 where it is stated that a switch to sqlite was made. As well in reference to #13369 that presently the iPhone app is very slow.

So the question was whether this switch to sqlite is supposed to improve iphone mobile app scalability or this is not expected to affect it.

I see, Thanks for the clarification. Yes, this is the first of many PRs in migrating to Sqlite. We do not use it yet, but hopefully, after few more releases, you should see some good improvements in the performance of the mobile app

@akostadinov
Copy link

Is there a high level description how it is supposed to work? Because I read Isar is famous for being fast although unsupported. So it's really interesting.

savely-krasovsky pushed a commit to savely-krasovsky/immich that referenced this pull request Jun 8, 2025
* refactor: user entity

* chore: rebase fixes

* refactor: remove int user Id

* refactor: migrate store userId from int to string

* refactor: rename uid to id

* feat: drift

* pr feedback

* refactor: move common overrides to mixin

---------

Co-authored-by: shenlong-tanwen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants