diff --git a/build/generated-resources/jte/META-INF/main.kotlin_module b/build/generated-resources/jte/META-INF/main.kotlin_module new file mode 100644 index 0000000..9dbc290 Binary files /dev/null and b/build/generated-resources/jte/META-INF/main.kotlin_module differ diff --git a/build/generated-resources/jte/gg/jte/generated/precompiled/JteIndexGenerated$Companion.class b/build/generated-resources/jte/gg/jte/generated/precompiled/JteIndexGenerated$Companion.class new file mode 100644 index 0000000..8cd2368 Binary files /dev/null and b/build/generated-resources/jte/gg/jte/generated/precompiled/JteIndexGenerated$Companion.class differ diff --git a/build/generated-resources/jte/gg/jte/generated/precompiled/JteIndexGenerated.class b/build/generated-resources/jte/gg/jte/generated/precompiled/JteIndexGenerated.class new file mode 100644 index 0000000..f31a6e9 Binary files /dev/null and b/build/generated-resources/jte/gg/jte/generated/precompiled/JteIndexGenerated.class differ diff --git a/build/generated-resources/jte/gg/jte/generated/precompiled/JteIndexGenerated.kt b/build/generated-resources/jte/gg/jte/generated/precompiled/JteIndexGenerated.kt new file mode 100644 index 0000000..3b1fa73 --- /dev/null +++ b/build/generated-resources/jte/gg/jte/generated/precompiled/JteIndexGenerated.kt @@ -0,0 +1,24 @@ +@file:Suppress("ktlint") +package gg.jte.generated.precompiled +import at.dokkae.homepage.templates.Index +@Suppress("UNCHECKED_CAST", "UNUSED_PARAMETER") +class JteIndexGenerated { +companion object { + @JvmField val JTE_NAME = "Index.kte" + @JvmField val JTE_LINE_INFO = intArrayOf(0,0,0,2,2,2,2,2,64,64,141,141,142,142,143,143,158,158,158,2,2,2,2,2) + @JvmStatic fun render(jteOutput:gg.jte.html.HtmlTemplateOutput, jteHtmlInterceptor:gg.jte.html.HtmlInterceptor?, model:Index) { + jteOutput.writeContent("\n\n\n\n \n \n Simple Chat — http4k + JTE + htmx\n\n \n \n\n \n\n\n
\n

Simple Chat

\n\n
\n ") + for (message in model.messages.reversed()) { + jteOutput.writeContent("\n ") + gg.jte.generated.precompiled.partials.JteMessageGenerated.render(jteOutput, jteHtmlInterceptor, message); + jteOutput.writeContent("\n ") + } + jteOutput.writeContent("\n
\n\n\n
\n \n \n \n
\n\n

No auth — anyone can post. Messages are stored only in memory.

\n
\n\n") + } + @JvmStatic fun renderMap(jteOutput:gg.jte.html.HtmlTemplateOutput, jteHtmlInterceptor:gg.jte.html.HtmlInterceptor?, params:Map) { + val model = params["model"] as Index + render(jteOutput, jteHtmlInterceptor, model); + } +} +} diff --git a/build/generated-resources/jte/gg/jte/generated/precompiled/partials/JteMessageGenerated$Companion.class b/build/generated-resources/jte/gg/jte/generated/precompiled/partials/JteMessageGenerated$Companion.class new file mode 100644 index 0000000..7f49799 Binary files /dev/null and b/build/generated-resources/jte/gg/jte/generated/precompiled/partials/JteMessageGenerated$Companion.class differ diff --git a/build/generated-resources/jte/gg/jte/generated/precompiled/partials/JteMessageGenerated.class b/build/generated-resources/jte/gg/jte/generated/precompiled/partials/JteMessageGenerated.class new file mode 100644 index 0000000..ea7798f Binary files /dev/null and b/build/generated-resources/jte/gg/jte/generated/precompiled/partials/JteMessageGenerated.class differ diff --git a/build/generated-resources/jte/gg/jte/generated/precompiled/partials/JteMessageGenerated.kt b/build/generated-resources/jte/gg/jte/generated/precompiled/partials/JteMessageGenerated.kt new file mode 100644 index 0000000..b93e8e4 --- /dev/null +++ b/build/generated-resources/jte/gg/jte/generated/precompiled/partials/JteMessageGenerated.kt @@ -0,0 +1,26 @@ +@file:Suppress("ktlint") +package gg.jte.generated.precompiled.partials +import at.dokkae.homepage.Message +@Suppress("UNCHECKED_CAST", "UNUSED_PARAMETER") +class JteMessageGenerated { +companion object { + @JvmField val JTE_NAME = "partials/Message.kte" + @JvmField val JTE_LINE_INFO = intArrayOf(0,0,0,2,2,2,2,2,5,5,5,5,6,6,6,8,8,8,10,10,10,2,2,2,2,2) + @JvmStatic fun render(jteOutput:gg.jte.html.HtmlTemplateOutput, jteHtmlInterceptor:gg.jte.html.HtmlInterceptor?, message:Message) { + jteOutput.writeContent("\n
\n ") + jteOutput.setContext("strong", null) + jteOutput.writeUserContent(message.author) + jteOutput.writeContent(":\n ") + jteOutput.setContext("div", null) + jteOutput.writeUserContent(message.content) + jteOutput.writeContent("\n \n (") + jteOutput.setContext("span", null) + jteOutput.writeUserContent(message.createdAt.toString()) + jteOutput.writeContent(")\n \n
") + } + @JvmStatic fun renderMap(jteOutput:gg.jte.html.HtmlTemplateOutput, jteHtmlInterceptor:gg.jte.html.HtmlInterceptor?, params:Map) { + val message = params["message"] as Message + render(jteOutput, jteHtmlInterceptor, message); + } +} +} diff --git a/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/DefaultCatalog.kt b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/DefaultCatalog.kt new file mode 100644 index 0000000..034f3de --- /dev/null +++ b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/DefaultCatalog.kt @@ -0,0 +1,43 @@ +/* + * This file is generated by jOOQ. + */ +package at.dokkae.homepage.generated.jooq + + +import kotlin.collections.List + +import org.jooq.Constants +import org.jooq.Schema +import org.jooq.impl.CatalogImpl + + +/** + * This class is generated by jOOQ. + */ +@Suppress("warnings") +open class DefaultCatalog : CatalogImpl("") { + companion object { + + /** + * The reference instance of DEFAULT_CATALOG + */ + val DEFAULT_CATALOG: DefaultCatalog = DefaultCatalog() + } + + /** + * standard public schema + */ + val PUBLIC: Public get(): Public = Public.PUBLIC + + override fun getSchemas(): List = listOf( + Public.PUBLIC + ) + + /** + * A reference to the 3.20 minor release of the code generator. If this + * doesn't compile, it's because the runtime library uses an older minor + * release, namely: 3.20. You can turn off the generation of this reference + * by specifying /configuration/generator/generate/jooqVersionReference + */ + private val REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_20 +} diff --git a/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/Public.kt b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/Public.kt new file mode 100644 index 0000000..772d0e4 --- /dev/null +++ b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/Public.kt @@ -0,0 +1,40 @@ +/* + * This file is generated by jOOQ. + */ +package at.dokkae.homepage.generated.jooq + + +import at.dokkae.homepage.generated.jooq.tables.Message + +import kotlin.collections.List + +import org.jooq.Catalog +import org.jooq.Table +import org.jooq.impl.DSL +import org.jooq.impl.SchemaImpl + + +/** + * standard public schema + */ +@Suppress("warnings") +open class Public : SchemaImpl(DSL.name("public"), DefaultCatalog.DEFAULT_CATALOG, DSL.comment("standard public schema")) { + companion object { + + /** + * The reference instance of public + */ + val PUBLIC: Public = Public() + } + + /** + * The table public.message. + */ + val MESSAGE: Message get() = Message.MESSAGE + + override fun getCatalog(): Catalog = DefaultCatalog.DEFAULT_CATALOG + + override fun getTables(): List> = listOf( + Message.MESSAGE + ) +} diff --git a/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/keys/Keys.kt b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/keys/Keys.kt new file mode 100644 index 0000000..f59d310 --- /dev/null +++ b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/keys/Keys.kt @@ -0,0 +1,21 @@ +@file:Suppress("warnings") +/* + * This file is generated by jOOQ. + */ +package at.dokkae.homepage.generated.jooq.keys + + +import at.dokkae.homepage.generated.jooq.tables.Message +import at.dokkae.homepage.generated.jooq.tables.records.MessageRecord + +import org.jooq.UniqueKey +import org.jooq.impl.DSL +import org.jooq.impl.Internal + + + +// ------------------------------------------------------------------------- +// UNIQUE and PRIMARY KEY definitions +// ------------------------------------------------------------------------- + +val MESSAGE_PKEY: UniqueKey = Internal.createUniqueKey(Message.MESSAGE, DSL.name("message_pkey"), arrayOf(Message.MESSAGE.ID), true) diff --git a/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/tables/Message.kt b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/tables/Message.kt new file mode 100644 index 0000000..4801187 --- /dev/null +++ b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/tables/Message.kt @@ -0,0 +1,187 @@ +/* + * This file is generated by jOOQ. + */ +package at.dokkae.homepage.generated.jooq.tables + + +import at.dokkae.homepage.generated.jooq.Public +import at.dokkae.homepage.generated.jooq.keys.MESSAGE_PKEY +import at.dokkae.homepage.generated.jooq.tables.records.MessageRecord + +import java.time.OffsetDateTime +import java.util.UUID + +import kotlin.collections.Collection + +import org.jooq.Condition +import org.jooq.Field +import org.jooq.ForeignKey +import org.jooq.InverseForeignKey +import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart +import org.jooq.Record +import org.jooq.SQL +import org.jooq.Schema +import org.jooq.Select +import org.jooq.Stringly +import org.jooq.Table +import org.jooq.TableField +import org.jooq.TableOptions +import org.jooq.UniqueKey +import org.jooq.impl.DSL +import org.jooq.impl.SQLDataType +import org.jooq.impl.TableImpl + + +/** + * This class is generated by jOOQ. + */ +@Suppress("warnings") +open class Message( + alias: Name, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, + aliased: Table?, + parameters: Array?>?, + where: Condition? +): TableImpl( + alias, + Public.PUBLIC, + path, + childPath, + parentPath, + aliased, + parameters, + DSL.comment(""), + TableOptions.table(), + where, +) { + companion object { + + /** + * The reference instance of public.message + */ + val MESSAGE: Message = Message() + } + + /** + * The class holding records for this type + */ + override fun getRecordType(): Class = MessageRecord::class.java + + /** + * The column public.message.id. + */ + val ID: TableField = createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, "") + + /** + * The column public.message.author. + */ + val AUTHOR: TableField = createField(DSL.name("author"), SQLDataType.VARCHAR(31).nullable(false), this, "") + + /** + * The column public.message.content. + */ + val CONTENT: TableField = createField(DSL.name("content"), SQLDataType.VARCHAR(255).nullable(false), this, "") + + /** + * The column public.message.created_at. + */ + val CREATED_AT: TableField = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false).defaultValue(DSL.field(DSL.raw("CURRENT_TIMESTAMP"), SQLDataType.TIMESTAMPWITHTIMEZONE)), this, "") + + /** + * The column public.message.updated_at. + */ + val UPDATED_AT: TableField = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, "") + + private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) + private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) + + /** + * Create an aliased public.message table reference + */ + constructor(alias: String): this(DSL.name(alias)) + + /** + * Create an aliased public.message table reference + */ + constructor(alias: Name): this(alias, null) + + /** + * Create a public.message table reference + */ + constructor(): this(DSL.name("message"), null) + override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC + override fun getPrimaryKey(): UniqueKey = MESSAGE_PKEY + override fun `as`(alias: String): Message = Message(DSL.name(alias), this) + override fun `as`(alias: Name): Message = Message(alias, this) + override fun `as`(alias: Table<*>): Message = Message(alias.qualifiedName, this) + + /** + * Rename this table + */ + override fun rename(name: String): Message = Message(DSL.name(name), null) + + /** + * Rename this table + */ + override fun rename(name: Name): Message = Message(name, null) + + /** + * Rename this table + */ + override fun rename(name: Table<*>): Message = Message(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition?): Message = Message(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Message = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition?): Message = where(DSL.and(*conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field?): Message = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Message = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Message = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Message = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Message = where(DSL.condition(condition, *parts)) + + /** + * Create an inline derived table from this table + */ + override fun whereExists(select: Select<*>): Message = where(DSL.exists(select)) + + /** + * Create an inline derived table from this table + */ + override fun whereNotExists(select: Select<*>): Message = where(DSL.notExists(select)) +} diff --git a/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/tables/pojos/Message.kt b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/tables/pojos/Message.kt new file mode 100644 index 0000000..7976170 --- /dev/null +++ b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/tables/pojos/Message.kt @@ -0,0 +1,76 @@ +/* + * This file is generated by jOOQ. + */ +package at.dokkae.homepage.generated.jooq.tables.pojos + + +import java.io.Serializable +import java.time.OffsetDateTime +import java.util.UUID + + +/** + * This class is generated by jOOQ. + */ +@Suppress("warnings") +data class Message( + val id: UUID, + val author: String, + val content: String, + val createdAt: OffsetDateTime? = null, + val updatedAt: OffsetDateTime? = null +): Serializable { + + override fun equals(other: Any?): Boolean { + if (this === other) + return true + if (other == null) + return false + if (this::class != other::class) + return false + val o: Message = other as Message + if (this.id != o.id) + return false + if (this.author != o.author) + return false + if (this.content != o.content) + return false + if (this.createdAt == null) { + if (o.createdAt != null) + return false + } + else if (this.createdAt != o.createdAt) + return false + if (this.updatedAt == null) { + if (o.updatedAt != null) + return false + } + else if (this.updatedAt != o.updatedAt) + return false + return true + } + + override fun hashCode(): Int { + val prime = 31 + var result = 1 + result = prime * result + this.id.hashCode() + result = prime * result + this.author.hashCode() + result = prime * result + this.content.hashCode() + result = prime * result + (if (this.createdAt == null) 0 else this.createdAt.hashCode()) + result = prime * result + (if (this.updatedAt == null) 0 else this.updatedAt.hashCode()) + return result + } + + override fun toString(): String { + val sb = StringBuilder("Message (") + + sb.append(id) + sb.append(", ").append(author) + sb.append(", ").append(content) + sb.append(", ").append(createdAt) + sb.append(", ").append(updatedAt) + + sb.append(")") + return sb.toString() + } +} diff --git a/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/tables/records/MessageRecord.kt b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/tables/records/MessageRecord.kt new file mode 100644 index 0000000..fb107a6 --- /dev/null +++ b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/tables/records/MessageRecord.kt @@ -0,0 +1,73 @@ +/* + * This file is generated by jOOQ. + */ +package at.dokkae.homepage.generated.jooq.tables.records + + +import at.dokkae.homepage.generated.jooq.tables.Message + +import java.time.OffsetDateTime +import java.util.UUID + +import org.jooq.Record1 +import org.jooq.impl.UpdatableRecordImpl + + +/** + * This class is generated by jOOQ. + */ +@Suppress("warnings") +open class MessageRecord private constructor() : UpdatableRecordImpl(Message.MESSAGE) { + + open var id: UUID + set(value): Unit = set(0, value) + get(): UUID = get(0) as UUID + + open var author: String + set(value): Unit = set(1, value) + get(): String = get(1) as String + + open var content: String + set(value): Unit = set(2, value) + get(): String = get(2) as String + + open var createdAt: OffsetDateTime? + set(value): Unit = set(3, value) + get(): OffsetDateTime? = get(3) as OffsetDateTime? + + open var updatedAt: OffsetDateTime? + set(value): Unit = set(4, value) + get(): OffsetDateTime? = get(4) as OffsetDateTime? + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + override fun key(): Record1 = super.key() as Record1 + + /** + * Create a detached, initialised MessageRecord + */ + constructor(id: UUID, author: String, content: String, createdAt: OffsetDateTime? = null, updatedAt: OffsetDateTime? = null): this() { + this.id = id + this.author = author + this.content = content + this.createdAt = createdAt + this.updatedAt = updatedAt + resetTouchedOnNotNull() + } + + /** + * Create a detached, initialised MessageRecord + */ + constructor(value: at.dokkae.homepage.generated.jooq.tables.pojos.Message?): this() { + if (value != null) { + this.id = value.id + this.author = value.author + this.content = value.content + this.createdAt = value.createdAt + this.updatedAt = value.updatedAt + resetTouchedOnNotNull() + } + } +} diff --git a/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/tables/references/Tables.kt b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/tables/references/Tables.kt new file mode 100644 index 0000000..4feda24 --- /dev/null +++ b/build/generated-src/jooq/at/dokkae/homepage/generated/jooq/tables/references/Tables.kt @@ -0,0 +1,15 @@ +@file:Suppress("warnings") +/* + * This file is generated by jOOQ. + */ +package at.dokkae.homepage.generated.jooq.tables.references + + +import at.dokkae.homepage.generated.jooq.tables.Message + + + +/** + * The table public.message. + */ +val MESSAGE: Message = Message.MESSAGE