|
|
|
@ -1,7 +1,12 @@ |
|
|
|
|
package main |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"database/sql" |
|
|
|
|
"fmt" |
|
|
|
|
|
|
|
|
|
"github.com/uptrace/bun" |
|
|
|
|
"github.com/uptrace/bun/dialect/pgdialect" |
|
|
|
|
"github.com/uptrace/bun/driver/pgdriver" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
// Tofu Provider is the goal
|
|
|
|
@ -18,6 +23,7 @@ import ( |
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
|
var ( |
|
|
|
|
<<<<<<< Updated upstream |
|
|
|
|
// ctx = context.Background()
|
|
|
|
|
dsn = "postgres://postgres:Initial1@localhost:15432/anvil?sslmode=disable" |
|
|
|
|
// dsn := "unix://user:pass@dbname/var/run/postgresql/.s.PGSQL.5432"
|
|
|
|
@ -41,4 +47,16 @@ func main() { |
|
|
|
|
// for _, val := range users {
|
|
|
|
|
// fmt.Printf("%s\n", val.Username)
|
|
|
|
|
// }
|
|
|
|
|
======= |
|
|
|
|
pgdsn = "postgres://postgres:Initial1@localhost:15432/anvil?sslmode=disable" |
|
|
|
|
) |
|
|
|
|
anvil := new(Anvil) |
|
|
|
|
anvil.AddStriker(Striker{}) |
|
|
|
|
// anvil.Strikers[0].SetFQDN("mh-striker01.libre.audio")
|
|
|
|
|
e := &PostgresClient{bun.NewDB(sql.OpenDB(pgdriver.NewConnector(pgdriver.WithDSN(pgdsn))), pgdialect.New())} |
|
|
|
|
|
|
|
|
|
anvil.Strikers[0].AddEndpoint(e) |
|
|
|
|
fmt.Printf("Strikers[0].Endpoints.PostgresClient = %s.\n", anvil.Strikers[0].Endpoints.PostgresClient) |
|
|
|
|
// fmt.Printf("Strikers[0].FQDN = %s.\n", anvil.Strikers[0].FQDN)
|
|
|
|
|
>>>>>>> Stashed changes |
|
|
|
|
} |
|
|
|
|