Exposed
Exposed copied to clipboard
Can be support table and column comment?
In MySQL use comment to add comments.
CREATE TABLE Users(
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'user id'
) COMMENT='user info'
Can you support it like this.
object Users : Table() {
val id = long("id")
.autoIncrement()
.comment("user id")
override val primaryKey = PrimaryKey(id)
override val tableComment = "user info"
}
It's an interesting requirement, but I think it may require more discussion about the correct design, because MySQL is a bit of an exception on how it approaches comments.
For example, PosgreSQL uses COMMENT statement that is separate from the table definition:
https://www.postgresql.org/docs/current/sql-comment.html
And Oracle uses similar approach to PostgreSQL, but with less options: https://docs.oracle.com/cd/B12037_01/server.101/b10759/statements_4009.htm
Starting with version 0.52.0, column comments in MySQL, MariaDB, H2, and SQLite will be available using:
object Users : Table("users") {
val id = long("id")
.autoIncrement()
.withDefinition("COMMENT", stringLiteral("user id"))
override val primaryKey = PrimaryKey(id)
}
Table comments (or column comments via separate COMMENT ON COLUMN) are still not supported. Please see EXPOSED-418 to bump/track this feature request.