db9010 / com.jovial.db9010 / Table / <init>

<init>

Table(tableName: String)

Base class for Table definitions. A table is defined by making a singleton object that implements this type, with TableColumn members. Columns register themselves with their table, which is the first parameter to their constructor.

Usage example:

    object People : Table("People") {
        val id = TableColumn(this, "id", "INT AUTO_INCREMENT", Types.sqlInt)
        val name = TableColumn(this, "name", "VARCHAR(50) NOT NULL", Types.sqlString)
        val worried = TableColumn(this, "worried", "BOOLEAN", Types.sqlBoolean)

        override val primaryKeys = listOf(id)
    }