This commit is contained in:
Jakub Kropáček 2025-03-10 22:39:32 +01:00
parent 90507b2987
commit 356270857f
6 changed files with 11 additions and 12 deletions

View file

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

View file

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

View file

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

View file

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

View file

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