- Kotlin Blueprints
- Ashish Belagali Hardik Trivedi Akshay Chordiya
- 106字
- 2021-07-02 21:50:14
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.
推薦閱讀
- C及C++程序設計(第4版)
- DevOps for Networking
- Windows系統管理與服務配置
- iOS開發實戰:從零基礎到App Store上架
- 深入淺出Windows API程序設計:編程基礎篇
- Oracle數據庫從入門到運維實戰
- Python Geospatial Development(Second Edition)
- MySQL數據庫管理與開發(慕課版)
- Learning DHTMLX Suite UI
- Android玩家必備
- 響應式架構:消息模式Actor實現與Scala、Akka應用集成
- Mastering Backbone.js
- Android移動應用開發項目教程
- Java EE 7 with GlassFish 4 Application Server
- Mastering Embedded Linux Programming