Hi! We’re starting to use Kotlin with Exposed at m...
# exposed
j
Hi! We’re starting to use Kotlin with Exposed at my company, and one thing I’m interested in is enforcing that tables and fields are documented. I noticed that there’s a PR open about including SQL comments as a feature (with e.g.
varchar("name").comment("The customer's first name")
), but there wasn’t much support for it. Can anyone here think of any good/idiomatic approaches, or is there an official one that I’ve missed?
One idea I’ve been toying with is creating a custom
ktlint
rule which literally checks that subclasses of
IdTable
and properties of those classes are prefixed with
/** kdoc comments */
Another approach would be to do something as part of documentation generation itself
But I will admit, those approaches are partly motivated by the fact that I can write them without needing to actually understand Exposed. I can certainly imagine that under the hood, there could be a way to do this at compile or run time, e.g. by hooking into table creation and requiring that tables/properties have decorators, or something.