~egtann/sum

sum/store.go -rw-r--r-- 588 bytes
7143d724 — Evan Tann add go1.15 workaround for broken google tls certs 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package sum

// Schema maps names to databases.
type Schema struct {
	Users     []string
	Databases map[string]Database
}

// Database maps names to tables.
type Database map[string]Table

// Table maps column names as a set.
type Table map[string]struct{}

type Store interface {
	// Statements reports all valid statements for the database. Things
	// like "select" and "alter". It must be an exhaustive list.
	Statements() []string

	// GetSchema for all databases.
	GetSchema() (*Schema, error)

	// Apply permissions in the DB for every user.
	Apply(map[string]*Permissions) error
}