40. “Goji first of all attempts to be simple. It
is of the Sinatra and Flask school of web
framework design, and not the Rails/
Django one.”
– github.com/zenazn/goji
68. Select
var people []Person
dbmap.Select(&people,
"select * from people order by id")
// Select single row
var person Person
dbmap.SelectOne(&person,
"select * from people where id=?", id)
// Select by primary key
obj, err := dbmap.Get(Person{}, 5)
p := obj.(*Person)
74. 設定の確認
Migrationの作成
$ goose status
goose: status for environment 'development'
$ goose create myapp sql
db/migration/YYYYMMDDhhmmss_myapp.sql
!が生成される
75. Migration用ファイルの編集
db/migration/YYYYMMDDhhmmss_myapp.sql
-- +goose Up
-- SQL in section 'Up' is executed when this migration is
applied
CREATE TABLE IF NOT EXISTS `people`(
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR() NOT NULL,
`Email` VARCHAR()
PRIMARY KEY (`id`))
ENGINE = InnoDB;
!
-- +goose Down
-- SQL section 'Down' is executed when this migration is
rolled back
DROP TABLE `people`;
80. “The `go get` command is useful. But we
want to fix the problem where package
versions are different from the latest
update. Are you going to do go get -
tags=1.1 ..., go get -tag=0.3 for each of
them? We want to freeze package
version. Ruby's bundle is awesome.”
– github.com/mattn/gom