Compare commits

..

1 commit

Author SHA1 Message Date
2196dc48d4
format 2025-09-25 14:43:47 +02:00
9 changed files with 18 additions and 14 deletions

View file

@ -3,14 +3,13 @@ package main
import (
"database/sql"
"flag"
"log"
"os"
"git.katuwoss.dev/JustScreaMy/secret-santa/internal/app"
"git.katuwoss.dev/JustScreaMy/secret-santa/internal/config"
_ "github.com/go-sql-driver/mysql"
_ "github.com/jackc/pgx/v5/stdlib"
_ "github.com/mattn/go-sqlite3"
"log"
"os"
)
var (

View file

@ -2,9 +2,10 @@ package app
import (
"database/sql"
"net/http"
"git.katuwoss.dev/JustScreaMy/secret-santa/internal/config"
"git.katuwoss.dev/JustScreaMy/secret-santa/internal/middlewares"
"net/http"
)
type App struct {

View file

@ -2,8 +2,9 @@ package app
import (
"database/sql"
"git.katuwoss.dev/JustScreaMy/secret-santa/internal/handlers"
"net/http"
"git.katuwoss.dev/JustScreaMy/secret-santa/internal/handlers"
)
func AddRoutes(router *http.ServeMux, db *sql.DB) {

View file

@ -3,12 +3,11 @@ package config
import (
"encoding/json"
"fmt"
"github.com/go-playground/validator/v10"
"io"
"os"
"path/filepath"
"github.com/go-playground/validator/v10"
"github.com/pelletier/go-toml/v2"
"gopkg.in/yaml.v3"
)

View file

@ -4,8 +4,9 @@ import (
"context"
"database/sql"
"errors"
"git.katuwoss.dev/JustScreaMy/secret-santa/internal/queries"
"net/http"
"git.katuwoss.dev/JustScreaMy/secret-santa/internal/queries"
)
func HandleGetUsers(db *sql.DB) http.HandlerFunc {

View file

@ -1,6 +1,10 @@
-- +migrate Up
CREATE TABLE users (
id UUID PRIMARY KEY,
id INTEGER PRIMARY KEY,
first_name VARCHAR(64) NOT NULL,
last_name VARCHAR(64) NOT NULL,
email VARCHAR(128) NOT NULL
);
);
-- +migrate Down
DROP TABLE IF EXISTS users;

View file

@ -1 +0,0 @@
DROP TABLE IF EXISTS users;

View file

@ -1,8 +1,8 @@
version: "2"
sql:
- engine: postgresql
queries: sql/queries/postgres/
schema: sql/migrations/postgres/
- engine: sqlite
queries: sql/queries/
schema: sql/migrations/
gen:
go:
package: "queries"