gostart/tmp.go

59 lines
1.2 KiB
Go
Raw Normal View History

2022-11-29 19:55:00 -07:00
package main
import (
"database/sql"
"log"
"suah.dev/gostart/data"
)
func tmpDBPopulate(db *sql.DB) {
// create tables
if _, err := db.ExecContext(app.ctx, schema); err != nil {
log.Fatal(err)
}
ownerID := int64(57395170551826799)
_, err := app.queries.AddOwner(app.ctx, data.AddOwnerParams{
2022-11-29 19:55:00 -07:00
ID: 57395170551826799,
Name: "europa.humpback-trout.ts.net.",
})
if err != nil {
log.Fatal(err)
}
2022-11-29 19:55:00 -07:00
b, err := app.queries.AddLink(app.ctx, data.AddLinkParams{
OwnerID: ownerID,
Url: "https://tapenet.org",
Name: "Tape::Net",
})
log.Println(b, err)
_, err = app.queries.AddPullRequest(app.ctx, data.AddPullRequestParams{
2022-11-29 19:55:00 -07:00
OwnerID: ownerID,
Number: 1234,
Repo: "NixOS/nixpkgs",
Description: sql.NullString{String: "who knows"},
})
if err != nil {
log.Fatal(err)
}
_, err = app.queries.AddWatchItem(app.ctx, data.AddWatchItemParams{
2022-11-29 19:55:00 -07:00
Name: "tailscale",
Repo: "NixOS/nixpkgs",
2022-11-29 19:55:00 -07:00
OwnerID: ownerID,
})
if err != nil {
log.Fatal(err)
}
2022-11-29 19:55:00 -07:00
_, err = app.queries.AddWatchItem(app.ctx, data.AddWatchItemParams{
2022-11-29 19:55:00 -07:00
Name: "openssh",
OwnerID: ownerID,
Repo: "NixOS/nixpkgs",
2022-11-29 19:55:00 -07:00
})
if err != nil {
log.Fatal(err)
}
2022-11-29 19:55:00 -07:00
}