I am following carefully
https://vertx.io/docs/vertx-pg-client/kotlin/ and I got:
Cannot access class 'io.vertx.pgclient.PgConnectOptions'. Check your module classpath for missing or conflicting dependencies
Cannot access class 'io.vertx.sqlclient.PoolOptions'. Check your module classpath for missing or conflicting dependencies
Unresolved reference: PgPool
My whole application is nothing else than a copy from the tutorial and I can't build it
app.kt
import io.vertx.kotlin.pgclient.PgConnectOptions
import io.vertx.kotlin.sqlclient.PoolOptions
class app {
fun main(args: Array<String>) {
// Connect options
var connectOptions = PgConnectOptions(
port = 5432,
host = "the-host",
database = "the-db",
user = "user",
password = "secret")
// Pool options
var poolOptions = PoolOptions(
maxSize = 5)
// Create the client pool
var client = PgPool.pool(connectOptions, poolOptions)
// A simple query
client.query("SELECT * FROM users WHERE id='julien'").execute({ ar ->
if (ar.succeeded()) {
var result = ar.result()
println("Got ${result.size()} rows ")
} else {
println("Failure: ${ar.cause().getMessage()}")
}
// Now close the pool
client.close()
})
}
}
and build.gradle
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.4.10'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib"
compile 'io.vertx:vertx-lang-kotlin:3.9.4'
}