Documentation
¶
Overview ¶
Package workspace is the second-library shape: it owns tables that refer to a user by id, and it does not import the auth library. The caller supplies the user id column, so any identity source works.
Index ¶
Constants ¶
const ( TableNameMember = "ws_member" TableAliasMember = "wm" ColWorkspaceID = "workspace_id" ColUserID = "user_id" ColRole = "role" )
The table and column names this plugin owns. Exported so another package can build its own alias over the same table without copying strings.
Variables ¶
var ( MemberWorkspaceID = sqlb.Col[string](TableMember, ColWorkspaceID) MemberUserID = sqlb.Col[string](TableMember, ColUserID) MemberRole = sqlb.Col[Role](TableMember, ColRole) )
The typed columns of TableMember. These are the plugin's schema contract: another package can join on them and scan them, and can do nothing else.
var TableMember = sqlb.Table{Name: TableNameMember, Alias: TableAliasMember}
TableMember is the membership table under this plugin's alias.
Functions ¶
func MemberBindings ¶
func MemberBindings(dst *Membership) []sqlb.Binding
MemberBindings binds the membership columns to dst.
Types ¶
type Membership ¶
Membership is the user's row in one workspace.
func (*Membership) Exists ¶
func (m *Membership) Exists() bool
Exists reports whether the LEFT join found a row.