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

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. 

主站蜘蛛池模板: 申扎县| 渑池县| 长宁县| 垫江县| 靖江市| 延边| 南安市| 巴楚县| 南康市| 中西区| 丰都县| 宣汉县| 于田县| 克山县| 洛宁县| 济南市| 兰溪市| 罗田县| 华蓥市| 婺源县| 崇阳县| 文成县| 沈阳市| 凉城县| 湘阴县| 荥经县| 漠河县| 浮山县| 法库县| 巫山县| 新乡县| 股票| 格尔木市| 汽车| 呼和浩特市| 社会| 漳平市| 临漳县| 翁源县| 临邑县| 东宁县|