mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: migrate nodeDB to Room database (#717)
This commit is contained in:
parent
99d7147efe
commit
83722159be
14 changed files with 742 additions and 148 deletions
|
|
@ -2,6 +2,8 @@ package com.geeksville.mesh.database
|
|||
|
||||
import android.app.Application
|
||||
import com.geeksville.mesh.database.dao.MeshLogDao
|
||||
import com.geeksville.mesh.database.dao.MyNodeInfoDao
|
||||
import com.geeksville.mesh.database.dao.NodeInfoDao
|
||||
import com.geeksville.mesh.database.dao.PacketDao
|
||||
import com.geeksville.mesh.database.dao.QuickChatActionDao
|
||||
import dagger.Module
|
||||
|
|
@ -18,6 +20,16 @@ class DatabaseModule {
|
|||
fun provideDatabase(app: Application): MeshtasticDatabase =
|
||||
MeshtasticDatabase.getDatabase(app)
|
||||
|
||||
@Provides
|
||||
fun provideMyNodeInfoDao(database: MeshtasticDatabase): MyNodeInfoDao {
|
||||
return database.myNodeInfoDao()
|
||||
}
|
||||
|
||||
@Provides
|
||||
fun provideNodeInfoDao(database: MeshtasticDatabase): NodeInfoDao {
|
||||
return database.nodeInfoDao()
|
||||
}
|
||||
|
||||
@Provides
|
||||
fun providePacketDao(database: MeshtasticDatabase): PacketDao {
|
||||
return database.packetDao()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue