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 Request(val messageId: Long, val userId: Long, val githubName: String, val repoName: String)

Represents a request in the database.

Link copied to clipboard
object Requests : Table

Represents the requests SQL table.

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
fun createRequest(messageId: Long, userId: Long, githubName: String, repoName: String): InsertStatement<Number>

Adds a request to the database.

Link copied to clipboard

Gets all requests currently linked in the database.

Link copied to clipboard

Gets all users currently linked in the database.

Link copied to clipboard
fun getRequest(messageId: Long): Request?

Gets a Request by its unique ID.

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

Gets a User by its jenkins username.

Link copied to clipboard

Removes all requests from the database.

Link copied to clipboard

Removes all users from the database.

Link copied to clipboard
fun removeRequest(messageId: Long): Int

Removes a request from the database.

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

Removes a user from the database.

Link copied to clipboard
fun requestExists(messageId: Long): Boolean

Checks if a request exists by its unique ID.

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

Updates the user linked in the database.