官术网_书友最值得收藏!

Defining the table

To define a table you need to create an object with the required fields and extend the Table class and Exposed will create the table in the database for you with the fields as columns:

    object Messages: Table() {
      val id = integer("id").autoIncrement().primaryKey()
      val name = varchar("name", 100)
    }

It will result in the following query called by Exposed:

    CREATE TABLE IF NOT EXISTS Messages (id INT AUTO_INCREMENT NOT 
NULL, name VARCHAR(100) NOT NULL, CONSTRAINT pk_Messages PRIMARY
KEY (id))

Currently Exposed doesn't have support for data classes and the repository pattern. It requires the creation of an object of the required structure. 

主站蜘蛛池模板: 和田县| 平原县| 铜梁县| 德令哈市| 双桥区| 漳浦县| 河津市| 屏东县| 凤阳县| 弥勒县| 永兴县| 阳曲县| 广汉市| 元江| 尤溪县| 德庆县| 塘沽区| 乳山市| 乌审旗| 长顺县| 盘锦市| 伊川县| 汝城县| 开江县| 临洮县| 贡山| 镶黄旗| 霍林郭勒市| 随州市| 湖北省| 云和县| 湘乡市| 济宁市| 孙吴县| 韶关市| 赫章县| 合山市| 得荣县| 平邑县| 全椒县| 清徐县|