package com.example.ayudapy import android.content.Context import androidx.room.Database import androidx.room.Room import androidx.room.RoomDatabase @Database(entities = arrayOf(PedidoSave::class), version = 1) abstract class PedidoDataBase : RoomDatabase() { abstract fun daoPedido(): DaoPedido companion object { private var INSTANCE: PedidoDataBase? = null fun getInstance(context: Context): PedidoDataBase? { if (INSTANCE == null) { synchronized(PedidoDataBase::class) { INSTANCE = Room.databaseBuilder(context.getApplicationContext(), PedidoDataBase::class.java, "pedidodata.db") .build() } } return INSTANCE } fun destroyInstance() { INSTANCE = null } } }