一:引言
在基礎課程中,我們學習到簡單手工代碼:驅動 https://github.com/go-sql-driver/mysql
今天我們介紹和引入Gorm:
github地址:
https://github.com/jinzhu/gorm
英文文檔:http://gorm.io
中文文檔:http://gorm.book.jasperxu.com/crud.html
安裝:在項目下執行
go get -u github.com/go-sql-driver/mysql
go get -u github.com/jinzhu/gorm
文檔地址:gorm.io/docs/connecting_to_the_database.html
對於比較復雜的sql 可以使用如上原生的方式