adding validated services? patching forcad_local.py

This commit is contained in:
Your Name
2026-08-13 08:32:35 +07:00
parent d485f61169
commit e795614e45
1459 changed files with 420036 additions and 436 deletions

View File

@@ -0,0 +1,32 @@
package db
import (
"context"
"log"
"omctf.ru/block-game-backend/codegen/ent"
)
var Client *ent.Client
func Initialize() {
ctx := context.Background()
var err error
Client, err = ent.Open("postgres", "host=postgres port=5432 user=postgres dbname=blockgame password=postgres sslmode=disable")
if err != nil {
log.Fatalf("failed opening connection to postgres: %v", err)
}
// uncomment to show the queries
// Client = Client.Debug()
// Run the auto migration tool.
if err := Client.Schema.Create(ctx); err != nil {
log.Fatalf("failed creating schema resources: %v", err)
}
}
func Close() {
Client.Close()
}