add EdgeDB dataschema and module
This commit is contained in:
@@ -7,3 +7,4 @@
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
data/
|
data/
|
||||||
.env
|
.env
|
||||||
|
*.edgeql
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
module default {
|
||||||
|
|
||||||
|
type GameBoard {
|
||||||
|
overloaded required id: uuid {
|
||||||
|
readonly := true;
|
||||||
|
constraint exclusive;
|
||||||
|
}
|
||||||
|
url: str {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
required created_at: datetime {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
required turns: int32 {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
required map: str {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
required single type: GameType {
|
||||||
|
readonly := true;
|
||||||
|
on source delete delete target;
|
||||||
|
}
|
||||||
|
required single ruleset: Ruleset {
|
||||||
|
readonly := true;
|
||||||
|
on source delete delete target;
|
||||||
|
}
|
||||||
|
required winner: str {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
required multi moves: Moves {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
required single snake: Snake {
|
||||||
|
readonly := true;
|
||||||
|
on source delete delete target;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type GameType {
|
||||||
|
required name: str {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
required is_ladder: bool {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type Ruleset {
|
||||||
|
required name: str {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
required version: str {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
required settings: json {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type Snake {
|
||||||
|
required type: str {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
calculations: array<json> {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type Moves {
|
||||||
|
required turn: int32 {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
required snake_move: str {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
required game_board: json {
|
||||||
|
readonly := true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[edgedb]
|
||||||
|
server-version = "5.3"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
blinker==1.7.0
|
blinker==1.7.0
|
||||||
click==8.1.7
|
click==8.1.7
|
||||||
|
edgedb==1.9.0
|
||||||
Flask==3.0.3
|
Flask==3.0.3
|
||||||
itsdangerous==2.2.0
|
itsdangerous==2.2.0
|
||||||
Jinja2==3.1.3
|
Jinja2==3.1.3
|
||||||
|
|||||||
@@ -138,3 +138,4 @@ class GameBoard:
|
|||||||
def save(self, store_class, **kwargs):
|
def save(self, store_class, **kwargs):
|
||||||
store = store_class(**kwargs)
|
store = store_class(**kwargs)
|
||||||
store.save(self)
|
store.save(self)
|
||||||
|
del store
|
||||||
|
|||||||
Reference in New Issue
Block a user