diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-24 16:10:48 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-24 16:10:48 +0000 |
commit | c3a6d0657eb2987aa13b53419269274d848d9e0c (patch) | |
tree | fcf161b74fffad2294efc0b558a0dfd1bc27d49b /server/src/Thermoprint/Server/Database.hs | |
parent | 7d3df6adce65e8840ef651a8a02a34a1a02083aa (diff) | |
download | thermoprint-c3a6d0657eb2987aa13b53419269274d848d9e0c.tar thermoprint-c3a6d0657eb2987aa13b53419269274d848d9e0c.tar.gz thermoprint-c3a6d0657eb2987aa13b53419269274d848d9e0c.tar.bz2 thermoprint-c3a6d0657eb2987aa13b53419269274d848d9e0c.tar.xz thermoprint-c3a6d0657eb2987aa13b53419269274d848d9e0c.zip |
Working printer config & debug printer
Diffstat (limited to 'server/src/Thermoprint/Server/Database.hs')
-rw-r--r-- | server/src/Thermoprint/Server/Database.hs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/server/src/Thermoprint/Server/Database.hs b/server/src/Thermoprint/Server/Database.hs index 29732e1..1e01680 100644 --- a/server/src/Thermoprint/Server/Database.hs +++ b/server/src/Thermoprint/Server/Database.hs | |||
@@ -9,16 +9,18 @@ | |||
9 | module Thermoprint.Server.Database | 9 | module Thermoprint.Server.Database |
10 | ( Job(..), JobId | 10 | ( Job(..), JobId |
11 | , Draft(..), DraftId | 11 | , Draft(..), DraftId |
12 | , Key(..) | ||
12 | , migrateAll | 13 | , migrateAll |
14 | , castId' | ||
13 | ) where | 15 | ) where |
14 | 16 | ||
15 | import Control.DeepSeq | 17 | import Control.DeepSeq |
16 | 18 | ||
17 | import Thermoprint.API (Printout, DraftTitle, JobStatus) | 19 | import Thermoprint.API (Printout, DraftTitle, JobStatus, castId) |
18 | 20 | ||
19 | import Database.Persist.TH | 21 | import Database.Persist.TH |
20 | import Database.Persist.Sql (unSqlBackendKey) | 22 | import Database.Persist.Sql (unSqlBackendKey, SqlBackend) |
21 | import Database.Persist.Class (Key) | 23 | import Database.Persist.Class (Key, BackendKey) |
22 | 24 | ||
23 | import Thermoprint.Server.Database.Instances | 25 | import Thermoprint.Server.Database.Instances |
24 | 26 | ||
@@ -32,3 +34,6 @@ Draft | |||
32 | 34 | ||
33 | instance NFData (Key Job) where | 35 | instance NFData (Key Job) where |
34 | rnf = rnf . unSqlBackendKey . unJobKey | 36 | rnf = rnf . unSqlBackendKey . unJobKey |
37 | |||
38 | castId' :: Enum b => BackendKey SqlBackend -> b | ||
39 | castId' = castId . unSqlBackendKey | ||