It is common the define a data class like this: ``...
# getting-started
z
It is common the define a data class like this:
Copy code
data class Connector(val url: String, val username: String, val pw: String) {

    fun connect(): Database = Database.connect(url, "com.impossibl.postgres.jdbc.PGDriver", username, pw)

}
n
I probably wouldn't put that method on there. it's not really related to the data class. if you really want that syntax though, an extension method would be a better fit.
👍 3