about summary refs log tree commit diff
path: root/nix/templates/goapp/backend/db.go
diff options
context:
space:
mode:
authorEmile <git@emile.space>2025-02-19 19:53:25 +0100
committerEmile <git@emile.space>2025-02-19 19:53:25 +0100
commitae39f02812bcfe903e956220c890bfb7b9bb9ff4 (patch)
treedff7028627665a7d2cb7cd64533ac74ec8919379 /nix/templates/goapp/backend/db.go
parent07425c679f7399284c0fe3dcbee54f45b23d07a0 (diff)
removed the backend, added the frontend with oidc support
So I've added oidc support which is nice, yet I have to test this
with some https foo, so I'm pushing this.
Diffstat (limited to 'nix/templates/goapp/backend/db.go')
-rw-r--r--nix/templates/goapp/backend/db.go37
1 files changed, 0 insertions, 37 deletions
diff --git a/nix/templates/goapp/backend/db.go b/nix/templates/goapp/backend/db.go
deleted file mode 100644
index fd3605a..0000000
--- a/nix/templates/goapp/backend/db.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package main
-
-import (
-	"database/sql"
-	"log"
-
-	_ "github.com/mattn/go-sqlite3"
-)
-
-const create string = `
-CREATE TABLE IF NOT EXISTS users (
-	id INTEGER NOT NULL PRIMARY KEY,
-	created_at DATETIME NOT NULL,
-	name TEXT,
-	passwordHash TEXT
-);
-`
-
-type State struct {
-	db       *sql.DB      // the database storing the "business data"
-	sessions *SqliteStore // the database storing sessions
-}
-
-func NewState() (*State, error) {
-	db, err := sql.Open("sqlite3", databasePath)
-	if err != nil {
-		log.Println("Error opening the db: ", err)
-		return nil, err
-	}
-	if _, err := db.Exec(create); err != nil {
-		log.Println("Error creating the tables: ", err)
-		return nil, err
-	}
-	return &State{
-		db: db,
-	}, nil
-}