com.skillw.pouvoir.internal.feature.database.mongodb.MongoContainerHolder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Pouvoir Show documentation
Show all versions of Pouvoir Show documentation
Bukkit Script Engine Plugin.
package com.skillw.pouvoir.internal.feature.database.mongodb
import com.mongodb.client.MongoClient
import com.mongodb.client.MongoDatabase
import com.skillw.pouvoir.api.feature.database.ContainerHolder
/**
* @className MongoContainerHolder
*
* @author Glom
* @date 2023/8/11 22:49 Copyright 2024 Glom.
*/
class MongoContainerHolder(private val mongoClient: MongoClient, database: String) : ContainerHolder() {
private val mongoDatabase: MongoDatabase = mongoClient.getDatabase(database)
override fun createContainer(tableName: String, userKey: Boolean): MongoContainer {
return MongoContainer(tableName, this, mongoDatabase)
}
override fun disconnect() {
mongoClient.close()
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy