aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-10-24 19:12:05 +0200
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-10-24 19:12:05 +0200
commita9a270ba1e1e9add10d75de3e592efee9728c5b4 (patch)
tree8f4bb9ba360c292c6fa2e2961c1d67293854364a
parent99a7e9ab02ae1980874be35f6a2651ca4bfdb951 (diff)
downloadlens-a9a270ba1e1e9add10d75de3e592efee9728c5b4.tar.gz
lens-a9a270ba1e1e9add10d75de3e592efee9728c5b4.tar.bz2
lens-a9a270ba1e1e9add10d75de3e592efee9728c5b4.zip
ref: Remove ggen entry
I have no intention of going further with that.
-rw-r--r--cmd/ggen/main.go43
1 files changed, 0 insertions, 43 deletions
diff --git a/cmd/ggen/main.go b/cmd/ggen/main.go
deleted file mode 100644
index b519739..0000000
--- a/cmd/ggen/main.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package main
-
-import (
- "github.com/sirupsen/logrus"
- "gorm.io/driver/sqlite"
- "gorm.io/gen"
- "gorm.io/gorm"
-
- "git.sr.ht/~gabrielgio/img/pkg/database/sql"
- "git.sr.ht/~gabrielgio/img/pkg/ext"
-)
-
-func main() {
- cfg := gen.Config{
- OutPath: "./pkg/database/sql/query",
- WithUnitTest: true,
- Mode: gen.WithoutContext | gen.WithDefaultQuery | gen.WithQueryInterface, // generate mode
- }
-
- g := gen.NewGenerator(cfg)
-
- logger := logrus.New()
- logger.SetLevel(logrus.TraceLevel)
- d := sqlite.Open("test.db")
- db, err := gorm.Open(d, &gorm.Config{
- Logger: ext.Wraplog(logger.WithField("context", "sql")),
- })
- if err != nil {
- panic("failed to gen database: " + err.Error())
- }
-
- g.UseDB(db)
-
- for _, m := range []any{
- &sql.User{},
- &sql.Settings{},
- &sql.Media{},
- } {
- g.ApplyBasic(m)
- }
-
- g.Execute()
-}