From 0df90837e295e03b04a682f586a02e834e72a9b9 Mon Sep 17 00:00:00 2001 From: Franklin Antony Date: Thu, 3 Dec 2020 16:17:51 +0000 Subject: [PATCH] Insertion working --- ChangeLog.md | 6 +- HolidayRecord.sqlite | Bin 16384 -> 16384 bytes LICENSE | 60 ++++++++-------- Setup.hs | 4 +- app/Main.hs | 55 ++++++++------- dist-newstyle/cache/config | Bin 0 -> 5857 bytes package.yaml | 106 ++++++++++++++-------------- src/Database.hs | 64 +++++++++++------ src/Http.hs | 30 ++++---- src/Parse.hs | 98 ++++++++++++++------------ stack.yaml | 138 ++++++++++++++++++------------------- stack.yaml.lock | 40 +++++------ test/Spec.hs | 4 +- 13 files changed, 322 insertions(+), 283 deletions(-) create mode 100644 dist-newstyle/cache/config diff --git a/ChangeLog.md b/ChangeLog.md index ed6df28..725e4ec 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,3 @@ -# Changelog for Holidays-in-UK - -## Unreleased changes +# Changelog for Holidays-in-UK + +## Unreleased changes diff --git a/HolidayRecord.sqlite b/HolidayRecord.sqlite index bdffaa379483c1a3377e96c397e133be1d3a19a5..f04c64116d03a1b2ef37a9a3254cb7639ad8e864 100644 GIT binary patch delta 795 zcmZ{gPiWIn9LJM3dtI{S{nia>Wy|uiR=ZBN^&dh752o$1gByx^@KnMYZMQZVY09jZ zw%|^Ba0JA=9>i0NN4*K2JUQ7x7zm0Wo&}G-L})AG?el*B-uL_McG+&1eLT;iqlE$> zX07m6WEduh%M9!f%!in71ws*7W_x)z0N33wAPGH@4Mil0?KRvoJcyH|w;_s$419za zV8c~d!ryQo-^WFa#ZO{iJRJ0PM3fXcMOk-?(mAv|%_)h5>qv2wnc|dm+I=Rip`5@e z*{pjirBIId@$4eSNgr={81nIm;w8i>`Mmpn@giED@Q;ad9K|_KiN)N@GC{eZKUoJUL=MG+gD;5QT}c32sylj>>r< zFnaLpaK@L9j~Vy@C-4Sd!V_pi8A@;g!uS{dijS%M0qy{muV|`j-K&{*Nl|alQWFVH zEmZAV(`o2UuNI+h(wcfhubB?HVpeS9AmKNn)LND{T8)Nb6ID0&$fi}VRrGe08vRd) z+NK>A=Vw@R1Kn9ZPSR-6uhN<+Y>W>Zk~pc*VK}3*V|-EZ~xVtr7=;-CB5lT z6g=tSQXXPMJI2QRRQxYxLFkq4aFxvkku1&OUx-w zwc=t`G&UADGB7gGHL%b%Hk@oICp?LOa72tpfG{6Kb*+Bw88{`bY zHrTVVDq32KPJSb22IlLrf?OazSwmjM9BiZ}3#+2CvM9tx6J0|C_x$`61-GKil*CFT zCdlmgc{MJO4p1;L2y8Y~u;iaO;UF6- F7XU~tUP}M~ diff --git a/LICENSE b/LICENSE index e637cde..6bb684e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,30 +1,30 @@ -Copyright Author name here (c) 2020 - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Author name here nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright Author name here (c) 2020 + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Author name here nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Setup.hs b/Setup.hs index 9a994af..833b4c6 100644 --- a/Setup.hs +++ b/Setup.hs @@ -1,2 +1,2 @@ -import Distribution.Simple -main = defaultMain +import Distribution.Simple +main = defaultMain diff --git a/app/Main.hs b/app/Main.hs index 9480d7e..731674e 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,26 +1,29 @@ -module Main where - -import Http -import Parse -import Database - -main :: IO () -main = do - let url = "https://date.nager.at/api/v2/publicholidays/2020/GB" - print "Downloading..." - json <- download url - print "Parsing" - case (parse json) of - Left err -> print err - -- Print first record - Right recs -> do - print recs - -- Print 5 records - -- Right recs -> print . (take 5) $ (HolidayRecord recs) - print "Saving on DB" - conn <- initialiseDB - insertDB conn recs - print "Done!" - - -- P.S It Outputs the haskell datatype we specified - +module Main where + +import Http +import Parse +import Database + +main :: IO () +main = do + let url = "https://date.nager.at/api/v2/publicholidays/2020/GB" + print "Downloading..." + json <- download url + print "Parsing" + case (parse json) of + Left err -> print err + -- Print first record + Right recs -> do + print recs + -- Print 5 records + -- Right recs -> print . (take 5) $ (HolidayRecord recs) + print "Saving on DB" + conn <- initialiseDB + insertDB conn recs + insertSB conn recs + insertLB conn recs + print "Done!" + + + -- P.S It Outputs the haskell datatype we specified + diff --git a/dist-newstyle/cache/config b/dist-newstyle/cache/config new file mode 100644 index 0000000000000000000000000000000000000000..51769139fd409385ac1601d65e320d3853f5b93d GIT binary patch literal 5857 zcmeHL&2QX96t|PzCL#TTv>aLiDxV0R6LL4}8tvCZ0j;Ndg3BfQa-E9ZKQx-^`VfByc5yDMALx4-@V z(_g#Ke>sm18_Jawl2q{%8f}L`q^v=@oy8+%<7^j^Ij_4-5%&n$33lCArpc%7?Z3&T{8@-lwYj^*Dx`ynb9T zso8r)SUvjY6hN5zQcroa*gFlyGFLQIm?^JX#a0{&kxH*k+5KTWNELS+gdRW6gUNO- zeQGNry)wmrMAp-Z0wM_$*1@dVE)N!e< zF+(#w!k9y-%Yj@^H~YX0aKL7+X%X(lh4r6h`^a|E??DGghg>?(Co+^F0T4`p)4%XWX4VvkZ37} z6+y*=A@ZXk9(3nJWSbOCOOu-Age?`4)RN1W0zWP*2-V6@JPzh6n?lY(YLIC5AX=q` zmbE-kgtRigKZkZxXjz=Y|7_)X;`!S+Pk&A-I|3g~GnDZKi!)w0|NiRw#Y^iV@^MYo z)Xtf4HjI-_M0cPwgam|g1+LSbQ3$66?Xh@AsE$r?5$clYdD}@(Das(ohGREJ5bT)W z(Ha-KR}-M#4n{|eeL*NenvTn!%_~)w@~!=3g0XA#!>tf#3Y`?7lMSKs!TOoC3+tUY z>TCqr=Gg7ftn>DMVu;zkTZ=JaaiyB_eT?yHw^StA+rdtBaCJzd0i2Hqm23}gnZUeI zp1X8h`%;tHX>waFK`VcXuKNoiPys5hfh_*fXseV$(f8>yq}*cQ!(=~X;}SA*#4 zm2=Hx%l*|WFW{~#?(ki> zj)!i#X5j)2qTVpA)(24^6UE8oKkh^dC_?&VpD}EJOWkakzncL2=wdg?(s-0jF8+LK zN4wYf`wfNfbT9r#6<-iI53{@XTnP#+ti1FD9NuSqdRXd}#$nD|UTuR^-&bF literal 0 HcmV?d00001 diff --git a/package.yaml b/package.yaml index 809cf2e..4116264 100644 --- a/package.yaml +++ b/package.yaml @@ -1,53 +1,53 @@ -name: Holidays-in-UK -version: 0.1.0.0 -github: "githubuser/Holidays-in-UK" -license: BSD3 -author: "Author name here" -maintainer: "example@example.com" -copyright: "2020 Author name here" - -extra-source-files: -- README.md -- ChangeLog.md - -# Metadata used when publishing your package -# synopsis: Short description of your package -# category: Web - -# To avoid duplicated efforts in documentation and dealing with the -# complications of embedding Haddock markup inside cabal files, it is -# common to point users to the README.md file. -description: Please see the README on GitHub at - -dependencies: -- base >= 4.7 && < 5 -- http-conduit -- bytestring -- aeson -- HDBC -- HDBC-sqlite3 - -library: - source-dirs: src - -executables: - Holidays-in-UK-exe: - main: Main.hs - source-dirs: app - ghc-options: - - -threaded - - -rtsopts - - -with-rtsopts=-N - dependencies: - - Holidays-in-UK - -tests: - Holidays-in-UK-test: - main: Spec.hs - source-dirs: test - ghc-options: - - -threaded - - -rtsopts - - -with-rtsopts=-N - dependencies: - - Holidays-in-UK +name: Holidays-in-UK +version: 0.1.0.0 +github: "githubuser/Holidays-in-UK" +license: BSD3 +author: "Author name here" +maintainer: "example@example.com" +copyright: "2020 Author name here" + +extra-source-files: +- README.md +- ChangeLog.md + +# Metadata used when publishing your package +# synopsis: Short description of your package +# category: Web + +# To avoid duplicated efforts in documentation and dealing with the +# complications of embedding Haddock markup inside cabal files, it is +# common to point users to the README.md file. +description: Please see the README on GitHub at + +dependencies: +- base >= 4.7 && < 5 +- http-conduit +- bytestring +- aeson +- HDBC +- HDBC-sqlite3 + +library: + source-dirs: src + +executables: + Holidays-in-UK-exe: + main: Main.hs + source-dirs: app + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - Holidays-in-UK + +tests: + Holidays-in-UK-test: + main: Spec.hs + source-dirs: test + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - Holidays-in-UK diff --git a/src/Database.hs b/src/Database.hs index 61beb89..d2921da 100644 --- a/src/Database.hs +++ b/src/Database.hs @@ -14,8 +14,6 @@ import Database.HDBC ) import Database.HDBC.Sqlite3 (Connection, connectSqlite3) import Parse - ( HolidayRecord (countryCode, date, global, localName, name), - ) -- This is a function that creates the tables -- if the tables do not exists yet @@ -27,15 +25,15 @@ initialiseDB = do "CREATE TABLE IF NOT EXISTS holidays (\ \ date VARCHAR(40) NOT NULL, \ \ localName VARCHAR(40) NOT NULL, \ - \ name VARCHAR(40) NOT NULL, \ - \ global BOOL DEFAULT NULL \ + \ name VARCHAR(40) NOT NULL \ \)" [] commit conn run conn "CREATE TABLE IF NOT EXISTS countries (\ - \ countryCode VARCHAR(40) NOT NULL \ + \ countryCode VARCHAR(40) NOT NULL, \ + \ global BOOL DEFAULT NULL \ \)" [] commit conn @@ -61,12 +59,30 @@ insertDB :: Connection -> [HolidayRecord] -> IO () insertDB conn records = do let xs = records -- need to use records and produce xs, this seems easiest possibility -- xs' <- filter (dateNotInDB conn) (nub xs) - stmt <- prepare conn "INSERT INTO holidays (date,localName,name,global) VALUES (?,?,?,?)" + stmt <- prepare conn "INSERT INTO holidays (date,localName,name) VALUES (?,?,?)" putStrLn "Adding" -- let xs'' = mapM_ (\x -> putStrLn $ " - " ++ x) xs' - executeMany stmt (map (\x -> [toSql (date x), toSql (localName x), toSql (name x), toSql (global x)]) xs) + executeMany stmt (map (\x -> [toSql (date x), toSql (localName x), toSql (name x)]) xs) commit conn +-- This function will insert the country records into the dsatabase +insertLB :: Connection -> [HolidayRecord] -> IO () +insertLB conn records = do + let xs = records + stmt <- prepare conn "INSERT INTO countries (countryCode,global) VALUES (?,?)" + putStrLn "Adding" + executeMany stmt (map (\x -> [toSql (countryCode x), toSql (global x)]) xs) + commit conn + +-- This function will insert the country_holidays records into the dsatabase +insertSB :: Connection -> [HolidayRecord] -> IO () +insertSB conn records = do + let xs = records + stmt <- prepare conn "INSERT INTO country_holidays (countryCode,localName) VALUES (?,?)" + putStrLn "Adding" + executeMany stmt (map (\x -> [toSql (countryCode x), toSql (localName x)]) xs) + commit conn + -- This function will select all the holidays of a given country queryDB :: Connection -> String -> IO [[SqlValue]] queryDB conn countryCode = do @@ -76,7 +92,9 @@ queryDB conn countryCode = do --This function will select all the holidays in the date specified of a given country querySQ :: Connection -> String -> IO Bool querySQ conn date = do - res <- quickQuery' conn "SELECT localName FROM holidays WHERE date BETWEEN'1-JAN-20'AND'31-JUL-20'"[toSql date] + let d1 = "31-JUL-20" + let d2 = "1-JAN-20" + res <- quickQuery' conn "SELECT localName FROM holidays WHERE date BETWEEN (?) AND (?)" [toSql date] return (length res == 0) -- This function will call all the names on the database. @@ -90,28 +108,34 @@ recordToSqlValues :: HolidayRecord -> [SqlValue] recordToSqlValues holidays = [ toSql $ date holidays, toSql $ localName holidays, - toSql $ name holidays, - toSql $ global holidays + toSql $ name holidays ] holidayToSqlValues :: HolidayRecord -> [SqlValue] holidayToSqlValues countries = - [ toSql $ countryCode countries + [ toSql $ countryCode countries, + toSql $ global countries ] + prepareInsertRecordStmt :: Connection -> IO Statement prepareInsertRecordStmt conn = prepare conn "INSERT INTO holidays VALUES (?,?)" -{- -prepareInsertHolidayStmt conn = prepare conn "INSERT INTO holiday VALUES (?,?,?)" -prepareInsertGlobalStmt conn = prepare conn "INSERT INTO country_holidays VALUES (?,?,?)" --} +prepareSelectRecordStma :: Connection -> IO Statement +prepareSelectRecordStma conn = prepare conn "SELECT FROM Country_holidays VALUES (?,?)" + + saveHolidayRecord :: [HolidayRecord] -> Connection -> IO () saveHolidayRecord records conn = do - stmt <- prepareInsertRecordStmt conn - executeMany stmt (map recordToSqlValues records) - commit conn - -dateNotInDB = undefined + stmt <- prepareInsertRecordStmt conn + executeMany stmt (map recordToSqlValues records) + commit conn +savecountriesRecord :: [HolidayRecord] -> Connection -> IO () +savecountriesRecord record conn = do + stma <- prepareSelectRecordStma conn + executeMany stma (map recordToSqlValues record) + commit conn + +dateNotInDB = undefined nub = undefined \ No newline at end of file diff --git a/src/Http.hs b/src/Http.hs index f343e55..3c95b58 100644 --- a/src/Http.hs +++ b/src/Http.hs @@ -1,15 +1,15 @@ -module Http - ( download - ) where - -import qualified Data.ByteString.Lazy.Char8 as L8 -import Network.HTTP.Simple - -type URL = String - -download :: String -> IO L8.ByteString -download url = do - request <- parseRequest url - response <- httpLBS request - return $ getResponseBody response - +module Http + ( download + ) where + +import qualified Data.ByteString.Lazy.Char8 as L8 +import Network.HTTP.Simple + +type URL = String + +download :: String -> IO L8.ByteString +download url = do + request <- parseRequest url + response <- httpLBS request + return $ getResponseBody response + diff --git a/src/Parse.hs b/src/Parse.hs index 4c2749e..4561a5e 100644 --- a/src/Parse.hs +++ b/src/Parse.hs @@ -1,43 +1,55 @@ -{-# LANGUAGE DeriveGeneric #-} - -module Parse where - -import Data.Aeson -import qualified Data.ByteString.Lazy.Char8 as L8 -import GHC.Generics - --- -- Sample format --- [ --- { --- "date": "2020-01-01", --- "localName": "New Year's Day", --- "name": "New Year's Day", --- "countryCode": "GB", --- "fixed": false, --- "global": true, --- "counties": null, --- "launchYear": null, --- "type": "Public" --- } --- ] -data HolidayRecord = HolidayRecord { - date :: String, - localName :: String, - name :: String, - countryCode :: String, - global::Bool -} deriving (Show, Generic) - - -instance FromJSON HolidayRecord -instance ToJSON HolidayRecord - --- data OuterRecords = OuterRecords{ --- records :: [InnerRecord] --- }deriving (Show, Generic) - --- instance FromJSON OuterRecords --- instance ToJSON OuterRecords - -parse :: L8.ByteString -> Either String [HolidayRecord] -parse json = eitherDecode json :: Either String [HolidayRecord] \ No newline at end of file +{-# LANGUAGE DeriveGeneric #-} + +module Parse where + +import Data.Aeson +import qualified Data.ByteString.Lazy.Char8 as L8 +import GHC.Generics + +-- -- Sample format +-- [ +-- { +-- "date": "2020-01-01", +-- "localName": "New Year's Day", +-- "name": "New Year's Day", +-- "countryCode": "GB", +-- "fixed": false, +-- "global": true, +-- "counties": null, +-- "launchYear": null, +-- "type": "Public" +-- } +-- ] +data HolidayRecord = HolidayRecord { + date :: String, + localName :: String, + name :: String, + countryCode :: String, + global::Bool +} deriving (Show, Generic) + +-- data CountriesRecord = CountriesRecord { +-- countryCode' :: String, +-- global::Bool +-- } deriving (Show, Generic) + +-- data Country_holidaysRecord = Country_holidaysRecord { +-- countryCode'' :: String, +-- localName' :: String +-- } deriving (Show, Generic) + +instance FromJSON HolidayRecord +instance ToJSON HolidayRecord + + + + +-- data OuterRecords = OuterRecords{ +-- records :: [InnerRecord] +-- }deriving (Show, Generic) + +-- instance FromJSON OuterRecords +-- instance ToJSON OuterRecords + +parse :: L8.ByteString -> Either String [HolidayRecord] +parse json = eitherDecode json :: Either String [HolidayRecord] diff --git a/stack.yaml b/stack.yaml index d211836..2f856d3 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,69 +1,69 @@ -# This file was automatically generated by 'stack init' -# -# Some commonly used options have been documented as comments in this file. -# For advanced use and comprehensive documentation of the format, please see: -# https://docs.haskellstack.org/en/stable/yaml_configuration/ - -# Resolver to choose a 'specific' stackage snapshot or a compiler version. -# A snapshot resolver dictates the compiler version and the set of packages -# to be used for project dependencies. For example: -# -# resolver: lts-3.5 -# resolver: nightly-2015-09-21 -# resolver: ghc-7.10.2 -# -# The location of a snapshot can be provided as a file or url. Stack assumes -# a snapshot provided as a file might change, whereas a url resource does not. -# -# resolver: ./custom-snapshot.yaml -# resolver: https://example.com/snapshots/2018-01-01.yaml -resolver: - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/23.yaml - -# User packages to be built. -# Various formats can be used as shown in the example below. -# -# packages: -# - some-directory -# - https://example.com/foo/bar/baz-0.0.2.tar.gz -# subdirs: -# - auto-update -# - wai -packages: -- . -# Dependency packages to be pulled from upstream that are not in the resolver. -# These entries can reference officially published versions as well as -# forks / in-progress versions pinned to a git hash. For example: -# -extra-deps: -- HDBC-sqlite3-2.3.3.1 -# - git: https://github.com/commercialhaskell/stack.git -# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a -# -# extra-deps: [] - -# Override default flag values for local packages and extra-deps -# flags: {} - -# Extra package databases containing global packages -# extra-package-dbs: [] - -# Control whether we use the GHC we find on the path -# system-ghc: true -# -# Require a specific version of stack, using version ranges -# require-stack-version: -any # Default -# require-stack-version: ">=2.5" -# -# Override the architecture used by stack, especially useful on Windows -# arch: i386 -# arch: x86_64 -# -# Extra directories used by stack for building -extra-include-dirs: -- 'C:\windows\system32\sql' -extra-lib-dirs: -- 'C:\windows\system32\sql' -# -# Allow a newer minor version of GHC than the snapshot specifies -# compiler-check: newer-minor +# This file was automatically generated by 'stack init' +# +# Some commonly used options have been documented as comments in this file. +# For advanced use and comprehensive documentation of the format, please see: +# https://docs.haskellstack.org/en/stable/yaml_configuration/ + +# Resolver to choose a 'specific' stackage snapshot or a compiler version. +# A snapshot resolver dictates the compiler version and the set of packages +# to be used for project dependencies. For example: +# +# resolver: lts-3.5 +# resolver: nightly-2015-09-21 +# resolver: ghc-7.10.2 +# +# The location of a snapshot can be provided as a file or url. Stack assumes +# a snapshot provided as a file might change, whereas a url resource does not. +# +# resolver: ./custom-snapshot.yaml +# resolver: https://example.com/snapshots/2018-01-01.yaml +resolver: + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/23.yaml + +# User packages to be built. +# Various formats can be used as shown in the example below. +# +# packages: +# - some-directory +# - https://example.com/foo/bar/baz-0.0.2.tar.gz +# subdirs: +# - auto-update +# - wai +packages: +- . +# Dependency packages to be pulled from upstream that are not in the resolver. +# These entries can reference officially published versions as well as +# forks / in-progress versions pinned to a git hash. For example: +# +extra-deps: +- HDBC-sqlite3-2.3.3.1 +# - git: https://github.com/commercialhaskell/stack.git +# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a +# +# extra-deps: [] + +# Override default flag values for local packages and extra-deps +# flags: {} + +# Extra package databases containing global packages +# extra-package-dbs: [] + +# Control whether we use the GHC we find on the path +# system-ghc: true +# +# Require a specific version of stack, using version ranges +# require-stack-version: -any # Default +# require-stack-version: ">=2.5" +# +# Override the architecture used by stack, especially useful on Windows +# arch: i386 +# arch: x86_64 +# +# Extra directories used by stack for building +extra-include-dirs: +- 'C:\windows\system32\sql' +extra-lib-dirs: +- 'C:\windows\system32\sql' +# +# Allow a newer minor version of GHC than the snapshot specifies +# compiler-check: newer-minor diff --git a/stack.yaml.lock b/stack.yaml.lock index 396d1be..c39a1e8 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -1,20 +1,20 @@ -# This file was autogenerated by Stack. -# You should not edit this file by hand. -# For more information, please see the documentation at: -# https://docs.haskellstack.org/en/stable/lock_files - -packages: -- completed: - hackage: HDBC-sqlite3-2.3.3.1@sha256:5025fd94d02b9b3f0b8b8233796dd9a85a0b3dda6503c6e671e3eddbc51cb4d4,2424 - pantry-tree: - size: 1427 - sha256: 76e71f73502350ed3fe5fc64604a21a3c8027d49fe6846183d53dbdaf583437a - original: - hackage: HDBC-sqlite3-2.3.3.1 -snapshots: -- completed: - size: 532832 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/23.yaml - sha256: fbb2a0519008533924c7753bd7164ddd1009f09504eb06674acad6049b46db09 - original: - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/23.yaml +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: +- completed: + hackage: HDBC-sqlite3-2.3.3.1@sha256:5025fd94d02b9b3f0b8b8233796dd9a85a0b3dda6503c6e671e3eddbc51cb4d4,2424 + pantry-tree: + size: 1427 + sha256: 76e71f73502350ed3fe5fc64604a21a3c8027d49fe6846183d53dbdaf583437a + original: + hackage: HDBC-sqlite3-2.3.3.1 +snapshots: +- completed: + size: 532832 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/23.yaml + sha256: fbb2a0519008533924c7753bd7164ddd1009f09504eb06674acad6049b46db09 + original: + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/23.yaml diff --git a/test/Spec.hs b/test/Spec.hs index cd4753f..ea04bb4 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -1,2 +1,2 @@ -main :: IO () -main = putStrLn "Test suite not yet implemented" +main :: IO () +main = putStrLn "Test suite not yet implemented"