Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureSchema ¶
EnsureSchema applies all relevant schema updates to the local database.
Return the initial schema version found before starting the update, along with any error occurred.
func FreshSchema ¶ added in v0.2.0
func FreshSchema() string
FreshSchema returns the fresh schema definition of the global database.
func MapDBError ¶
func MaxSupportedSchema ¶ added in v0.2.0
func MaxSupportedSchema() int
func SchemaDotGo ¶ added in v0.2.0
func SchemaDotGo() error
SchemaDotGo refreshes the schema.go file in this package, using the updates defined here.
Types ¶
type Node ¶
type Node struct {
DB *sql.DB // Handle to the local SQLite database file.
Dir string // Reference to the directory where the database file lives.
}
Node represents access to the local database.
func (*Node) SchemaVersion ¶ added in v0.2.0
func (*Node) Transaction ¶
Transaction executes the database interactions invoked by the given function. If the function returns no error, all database changes are committed to the database, otherwise they are rolled back.
Click to show internal directories.
Click to hide internal directories.