Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SchemaVersion = len(updates)
SchemaVersion is the current version of the cluster database schema.
Functions ¶
func EnsureSchema ¶
EnsureSchema applies all relevant schema updates to the cluster database.
Before actually doing anything, this function will make sure that all nodes in the cluster have a schema version and a number of API extensions that match our one. If it's not the case, we either return an error (if some nodes have version greater than us and we need to be upgraded), or return false and no error (if some nodes have a lower version, and we need to wait till they get upgraded and restarted).
func Open ¶
Open the cluster database object.
The name argument is the name of the cluster database. It defaults to 'db.bin', but can be overwritten for testing.
The dialer argument is a function that returns a gRPC dialer that can be used to connect to a database node using the gRPC SQL package.
func SchemaDotGo ¶
func SchemaDotGo() error
SchemaDotGo refreshes the schema.go file in this package, using the updates defined here.
Types ¶
This section is empty.