Out of curiosity, has anyone ever used TimescaleDB...
# exposed
m
Out of curiosity, has anyone ever used TimescaleDB together with Exposed and had any problems or learnings etc.?
👀 1
a
@maxmello any chance you tried this out?
m
Funnily enough, we still plan to use it together. Our postgres cluster has timescale installed, but we haven't built anything on top of it yet. I think due to the great extensibility of Exposed, it should be no problem.
a
That is kind of how I have been leaning as well.
m
The timing is kind of funny, but we just deployed our first small use case. What seems to just have worked is this as a base class:
Copy code
open class HyperTable(name: String = "", timeColumnName: String = "time") : Table(name) {
    val time = timestamp(timeColumnName)

    override fun createStatement(): List<String> {
        return super.createStatement() + listOf("SELECT create_hypertable('${this.tableName}','${time.name}')")
    }
}
Most documentation recommends using timestampWithTimeZone, but for our specific use case, handling time zones manually works better. Right now, we only insert into the table and have not yet build any queries on top of it