MoyuruAizawa / AutoExposed

Generate JetBrains/Exposed codes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AutoExposed - Kotlin SQL Library

AutoExposed is a SQL library wrapping JetBrains/Exposed.
It generates Exposed codes by using JSR-369(Annotation Processing). Currentry, it supports generating Table object but will support generating CRUD codes.

WARNING: AutoExposed is under heavy development.

Define Table

@Table
data class Person(
    @PrimaryKey(autoIncrement = true) val id: Long,
    @Column(length = 256, index = true) val name: String,
    @Column val age: Int,
    @Column(length = 256) val job: String?)

AutoExposed generates the following object based on the above data class.

object PersonTable : Table("person") {
    val id: Column<Long> = long("id").primaryKey().autoIncrement()
    val name: Column<String> = varchar("name", length = 256).index()
    val age: Column<Int> = integer("age")
    val job: Column<String?> = varchar("job", length = 256).nullable()
}

About

Generate JetBrains/Exposed codes.

License:Apache License 2.0


Languages

Language:Kotlin 100.0%