コード例 #1
0
func TestSelectManager(t *testing.T) {
	relation := nodes.Relation("table")
	mgr := managers.Selection(relation)

	// The following struct members should exist.
	_ = mgr.Tree
	_ = mgr.Context
	_ = mgr.Engine

	// The following receiver methods should exist.
	_ = mgr.Project(1)
	_ = mgr.Where(1)
	_ = mgr.Offset(1)
	_ = mgr.Limit(1)
	_ = mgr.InnerJoin(1)
	_ = mgr.OuterJoin(1)
	_ = mgr.On(1)
	_ = mgr.Order(1)
	_ = mgr.Group(1)
	_ = mgr.Having(1)
	_ = mgr.Union(managers.Selection(relation))
	_ = mgr.Intersect(managers.Selection(relation))
	_ = mgr.Except(managers.Selection(relation))
	_ = mgr.Engine(1)
	_, _ = mgr.ToSql()
}
コード例 #2
0
ファイル: relation.go プロジェクト: jroes/librarian-1
func InitializeRelation(table Table) (relation *Relation) {
	relation = new(Relation)
	relation.Table = table
	relation.Accessor = codex.Table(table.Name)
	relation.Mananger = managers.Selection(relation.Accessor.Relation())

	return
}