All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.skillw.pouvoir.internal.feature.database.sql.sqlite.SQLite.kt Maven / Gradle / Ivy

There is a newer version: 1.6.7-beta-6
Show newest version
package com.skillw.pouvoir.internal.feature.database.sql.sqlite

import com.skillw.pouvoir.api.feature.database.DatabaseType
import com.skillw.pouvoir.api.plugin.annotation.AutoRegister
import com.skillw.pouvoir.api.plugin.map.DataMap
import com.skillw.pouvoir.internal.feature.database.sql.NormalContainer
import taboolib.common.io.newFile
import taboolib.module.database.Host
import taboolib.module.database.HostSQLite
import taboolib.module.database.SQLite
import java.io.File

@AutoRegister
internal object SQLite : DatabaseType, SQLite>>("sqlite") {

    override fun connect(params: DataMap): SQLiteContainerHolder {
        val path = params.get("path", "plugins/Pouvoir/database.db")
        val syncTime = params.get("user-container-sync-time", 360000L)
        val dataFile = newFile(File(path))
        val host = HostSQLite(dataFile)
        return SQLiteContainerHolder(host).apply { userContainerSyncTime = syncTime }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy