From a6007bffdbbeb8391b2b8991377857c475308e83 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 2 Aug 2017 01:59:47 +0200 Subject: 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. --- src/Plugin/GitHubCommit.hs | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.3