summaryrefslogtreecommitdiff
path: root/transactions.lisp
blob: 2c65434b81c84c1134b7a02059119f7313f7ed96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
;;;; transactions.lisp -- data store transactions for dnd

(in-package :dnd)

(defun birth-from-the-goddess-loins (name)
  (db:with-transaction ()
    (make-instance 'hero :name name)))

(defun new-sesh (player)
  (db:with-transaction () (make-instance 'session :player player)))

(defun destroy-sesh (session)
  (db:with-transaction () 
    (db:delete-object session)))

(defun register-player (nick)
  (db:with-transaction ()
    (make-instance 'player :nick nick)))