summaryrefslogtreecommitdiff
path: root/haskell/src/SpaceTraders/Database/Ships.hs
blob: 81c422db8fdf207f02ea347c67647162ab59a22c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{-# LANGUAGE OverloadedStrings #-}

module SpaceTraders.Database.Ships
  ( addShip
  ) where

import Data.Aeson
import qualified Database.SQLite.Simple as S

import SpaceTraders.Model.Ship

addShip :: S.Connection -> Ship -> IO ()
addShip conn ship = S.execute conn "INSERT INTO ships(data) VALUES (json(?));" (S.Only (encode ship))