Update to goprogram 0.1.0
This commit is contained in:
parent
d2d681a4f2
commit
7cda92b342
31 changed files with 141 additions and 244 deletions
|
|
@ -91,7 +91,7 @@ func (sql *SQL) QueryTable(silent bool, table string) (*gorm.DB, error) {
|
|||
// WaitQueryTable waits for a connection to succeed via QueryTable
|
||||
func (sql *SQL) WaitQueryTable() error {
|
||||
// TODO: Establish a convention on when to wait for this!
|
||||
n := stream.FromDebug()
|
||||
n := stream.FromNil()
|
||||
return wait.Wait(func() bool {
|
||||
_, err := sql.QueryTable(true, models.InstanceTable)
|
||||
n.EPrintf("[SQL.WaitQueryTable]: %s\n", err)
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ import (
|
|||
"github.com/tkw1536/goprogram/stream"
|
||||
)
|
||||
|
||||
func (SQL) SnapshotNeedsRunning() bool { return false }
|
||||
func (*SQL) SnapshotNeedsRunning() bool { return false }
|
||||
|
||||
func (SQL) SnapshotName() string { return "sql" }
|
||||
func (*SQL) SnapshotName() string { return "sql" }
|
||||
|
||||
func (sql *SQL) Snapshot(wisski models.Instance, context component.StagingContext) error {
|
||||
return context.AddDirectory(".", func() error {
|
||||
|
|
|
|||
|
|
@ -22,15 +22,15 @@ type SQL struct {
|
|||
lazyNetwork lazy.Lazy[string]
|
||||
}
|
||||
|
||||
func (SQL) Name() string {
|
||||
func (*SQL) Name() string {
|
||||
return "sql"
|
||||
}
|
||||
|
||||
func (sql SQL) Path() string {
|
||||
func (sql *SQL) Path() string {
|
||||
return filepath.Join(sql.Core.Config.DeployRoot, "core", sql.Name())
|
||||
}
|
||||
|
||||
func (SQL) Context(parent component.InstallationContext) component.InstallationContext {
|
||||
func (*SQL) Context(parent component.InstallationContext) component.InstallationContext {
|
||||
return parent
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ func (sql *SQL) Shell(io stream.IOStream, argv ...string) (int, error) {
|
|||
|
||||
// unsafeWaitShell waits for a connection via the database shell to succeed
|
||||
func (sql *SQL) unsafeWaitShell() error {
|
||||
n := stream.FromDebug()
|
||||
n := stream.FromNil()
|
||||
return wait.Wait(func() bool {
|
||||
code, err := sql.Shell(n, "-e", "select 1;")
|
||||
n.EPrintf("[SQL.unsafeWaitShell]: %d %s\n", code, err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue