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

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. 

主站蜘蛛池模板: 陈巴尔虎旗| 台中市| 夏津县| 湘阴县| 桂东县| 阿城市| 望江县| 光泽县| 赣州市| 宝应县| 曲周县| 舟曲县| 万源市| 兰坪| 安宁市| 通山县| 长海县| 满洲里市| 五峰| 淮滨县| 得荣县| 长治县| 临湘市| 屏东县| 同江市| 惠东县| 延寿县| 南召县| 徐闻县| 仲巴县| 柳河县| 尉氏县| 三门县| 卫辉市| 洪江市| 阜阳市| 方正县| 巩留县| 延川县| 堆龙德庆县| 噶尔县|