Upload files to "v1"

This commit is contained in:
2025-12-22 15:15:42 +00:00
parent d5de70103a
commit cd100b6904
44 changed files with 4420 additions and 0 deletions

22
v1/database.go Normal file
View File

@@ -0,0 +1,22 @@
package db
import (
"angel_server/consts"
"database/sql"
"log"
_ "github.com/mattn/go-sqlite3"
)
func CheckLayer(db *sql.DB, layerID int) bool {
var exists bool
query := `SELECT EXISTS(SELECT 1 FROM layers WHERE layer_id = ?);`
err := consts.Db.QueryRow(query, layerID).Scan(&exists)
if err != nil {
log.Fatal(err)
}
return exists
}