Package-level declarations

Types

Link copied to clipboard
data class DBConfig(val url: String, val username: String, val password: String)

The MariaDB configuration.

Link copied to clipboard
data class User(val username: String, val discord: Long)

Represents a user in the database.

Link copied to clipboard
object Users : Table

Represents the users SQL table.

Properties

Link copied to clipboard
lateinit var database: Database

Represents the database connection.

Link copied to clipboard

The DBConfig instance.

Functions

Link copied to clipboard
fun addUser(username: String, discord: Long): InsertStatement<Number>

Adds a user to the database.

Link copied to clipboard
fun connect(): Database

Attempts to connect to the database.

Link copied to clipboard

Gets all users currently linked in the database.

Link copied to clipboard
fun getUser(username: String): User?

Gets a User by its jenkins username.

Link copied to clipboard

Removes all users from the database.

Link copied to clipboard
fun removeUser(username: String): Int

Removes a user from the database.

Link copied to clipboard
fun updateUser(username: String, discord: Long): Int

Updates the user linked in the database.