package com.laseroptek.raman.data.source.db

import com.laseroptek.raman.data.datasource.db.RamanDatabase
import com.laseroptek.raman.data.source.db.model.SerialLog
import kotlinx.coroutines.flow.Flow

class RamanDatabaseService(private val ramanDatabase: RamanDatabase) : DatabaseService {
    override fun selectSerialLog(maxRecord: Int): Flow<List<SerialLog>> {
        return ramanDatabase.serialLogDao().selectSerialLog(maxRecord)
    }

    override suspend fun insertSerialLog(serialLog: SerialLog) {
        ramanDatabase.serialLogDao().insertSerialLog(serialLog)
    }

    override suspend fun trimLogs(limit: Int) {
        ramanDatabase.serialLogDao().trimLogs(limit)
    }
}