aboutsummaryrefslogtreecommitdiffstats
path: root/src/Plugin/GitHubCommit.hs
diff options
context:
space:
mode:
authorTeddy Wing2017-08-02 01:59:47 +0200
committerTeddy Wing2017-08-02 01:59:47 +0200
commita6007bffdbbeb8391b2b8991377857c475308e83 (patch)
treedf466b12a14f61b44344355fb515fe06f3863716 /src/Plugin/GitHubCommit.hs
parent04a9fc75e23f2903d8df07e3cd20e7dba64959b1 (diff)
downloadsorbot-a6007bffdbbeb8391b2b8991377857c475308e83.tar.bz2
GitHubCommit.hs: Add `ChannelRepoUrl` database type
A type that will be used in conjunction with 'sqlite-simple' to read values from the plugin's database table.
Diffstat (limited to 'src/Plugin/GitHubCommit.hs')
-rw-r--r--src/Plugin/GitHubCommit.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Plugin/GitHubCommit.hs b/src/Plugin/GitHubCommit.hs
index 8fa8d0a..e5af381 100644
--- a/src/Plugin/GitHubCommit.hs
+++ b/src/Plugin/GitHubCommit.hs
@@ -15,3 +15,9 @@ gitHubCommit = Plugin
gitHubCommitAction :: PluginAction
gitHubCommitAction message =
"https://github.com/" ++ M.text message =~ matchRegex gitHubCommit
+
+-- | A type to match the database table for this plugin.
+data ChannelRepoUrl = ChannelRepoUrl Int String String deriving (Show)
+
+instance FromRow ChannelRepoUrl where
+ fromRow = ChannelRepoUrl <$> field <*> field <*> field