feat: introduce Data Access Object - #1736
Closed
ethicnology wants to merge 7 commits into
Closed
Conversation
ethicnology
force-pushed
the
introduce-data-access-object
branch
from
January 7, 2026 19:02
358b95d to
f4dd9f3
Compare
…belsLocalDatasource across wallet and exchange modules
Member
Author
|
DAO are not as useful as expected in the planned Architecture where each feature is encapsuling database calls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
6.5.0This design pattern is used to abstract and encapsulate all access to the database by extracting queries into classes that are available from your main database class.
This will also simplify our life if one day we have to replace drift, since these classes have to be injected.
Currently we have one DAO per table, but we can design more complex DAO accessing multiple tables in the future.
The next step will be to replace 73 direct database accesses across 13 datasources
into().insert,managers.settings.filter().getSingle, 10xmanagers.settings.updateSettingsDaointo().insertOnConflictUpdate,managers.walletMetadatas.filter().getSingleOrNull,managers.walletMetadatas.get(),managers.walletMetadatas.filter().delete()WalletMetadatasDaomanagers.labels.create,batch(), 2xmanagers.labels.filter().get(), 3xmanagers.labels.filter().delete(),managers.labels.get(),selectOnly(),delete().go()LabelsDaointo().insertOnConflictUpdate, 2xselect().where().getSingle,managers.swaps.filter().getSingleOrNull,managers.swaps.filter().get(),managers.swaps.filter().delete()SwapsDao,AutoSwapDaointo().insertOnConflictUpdate, 2xmanagers.filter().getSingleOrNull, 4xmanagers.filter().get()PayjoinSendersDao,PayjoinReceiversDaointo().insertOnConflictUpdate,batch(), 4xmanagers.electrumServers.filter().get(),managers.electrumServers.filter().delete()ElectrumServersDaointo().insertOnConflictUpdate,managers.electrumSettings.get(), 2xmanagers.electrumSettings.filter().get/getSingle()ElectrumSettingsDaomanagers.transactions.filter().getSingleOrNull,into().insertTransactionsDaointo().insertOnConflictUpdate,managers.mempoolServers.filter().getSingleOrNull,managers.mempoolServers.filter().delete()MempoolServersDaointo().insertOnConflictUpdate,managers.mempoolSettings.filter().getSingleOrNullMempoolSettingsDaomanagers.bip85Derivations.create, 3xmanagers.bip85Derivations.filter().get/getSingleOrNull, 3xmanagers.bip85Derivations.filter().updateBip85DerivationsDaointo().insertOnConflictUpdate, 2xmanagers.recoverbull.filter().getSingle,managers.recoverbull.updateRecoverbullDaobatch(),select().where(), 2xdelete().where()PricesDao