Testing

module Tests where
import T1QuerySerialization (t1)
  1. Builds queries like

    SELECT CAST(5, 'UInt8') as testSample;

    via ToQueryPart type class
    for every supported type

  2. Executes select

  3. Parses the result

  4. Checks if result equals initial value

import T2WriteReadEquality (t2)
  1. Runs insertInto of a sample into the all supported types table
  2. Runs selectFrom from the same table
  3. Checks if result equals sample value

How to run

You can manually run database and tests:

nix run .#testing

Main function

import ClickHaskell (ChCredential(..), openNativeConnection, defaultCredentials)

main :: IO ()
main = do
  connection <- openNativeConnection defaultCredentials
  mapM_
    (\runner -> runner connection) 
    [t1,t2]