Basic sqlite Implementation

This commit is contained in:
2021-01-04 00:16:58 -05:00
parent 944a3163e9
commit e8003f15d7
12 changed files with 192 additions and 56 deletions

View File

@@ -2,9 +2,12 @@ package cmd
import (
"reichard.io/imagini/routes"
"reichard.io/imagini/db"
"github.com/urfave/cli/v2"
"net/http"
"log"
"fmt"
)
var CmdServe = cli.Command{
@@ -14,6 +17,13 @@ var CmdServe = cli.Command{
Action: serveWeb,
}
var CmdDBTest = cli.Command{
Name: "db",
Aliases: []string{"d"},
Usage: "test db.",
Action: testDatabase,
}
func serveWeb(ctx *cli.Context) error {
routes.RegisterRoutes()
@@ -22,3 +32,9 @@ func serveWeb(ctx *cli.Context) error {
}
return nil
}
func testDatabase(ctx *cli.Context) error {
resp := db.ItemsFromAlbum(1, 3)
fmt.Printf("%v", resp)
return nil
}