Changed Int to Int32 for tests (tests were failing)

This commit is contained in:
Alexander Granin 2024-09-03 15:03:22 +04:00
parent 7ce16e705c
commit 47e8938a2e
13 changed files with 453 additions and 53 deletions

View File

@ -1,10 +1,10 @@
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.33.0.
-- This file has been generated from package.yaml by hpack version 0.35.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 28eee222954224a8d9f86601887d0c0700a7f1884df9c8976654370c976fc1b3
-- hash: 9c3f9c5e57376274c872d87a03e33982b888776180cf6e4bd996a73d78ec097a
name: MeteorCounter
version: 1.0.0.0
@ -33,7 +33,32 @@ library
Paths_MeteorCounter
hs-source-dirs:
src
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -Wall -Wcompat -Widentities -fhide-source-paths
build-depends:
MonadRandom
@ -124,7 +149,32 @@ executable MeteorCounter
Paths_MeteorCounter
hs-source-dirs:
src/
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
build-depends:
MonadRandom

View File

@ -1,10 +1,10 @@
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.33.0.
-- This file has been generated from package.yaml by hpack version 0.35.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 3d6279aa72a380ca3b4bebfd9d06e19a48745f51b0cbbd1b7a7a13ab61ac1e9e
-- hash: b5f82b04dd30f2e049414c2566890da71bf9bfc3ac2c03b58a1d8f1f124196aa
name: PerfTestApp
version: 1.0.0.0
@ -32,7 +32,32 @@ library
Paths_PerfTestApp
hs-source-dirs:
src
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -Wall -Wcompat -Widentities -fhide-source-paths
build-depends:
MonadRandom
@ -122,7 +147,32 @@ executable PerfTestApp
Paths_PerfTestApp
hs-source-dirs:
src/
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
build-depends:
MonadRandom

View File

@ -1,10 +1,10 @@
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.33.0.
-- This file has been generated from package.yaml by hpack version 0.35.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: c822eb7c7a47c991d0296be18c2d5e4cf07faf6a2e5b855ca766560a34221330
-- hash: 2807168ef11b8cc41403aeacd25d5878cd593ce987c9337ecbde9131ef943b18
name: PerfTestApp2
version: 1.0.0.0
@ -32,7 +32,32 @@ library
Paths_PerfTestApp2
hs-source-dirs:
src
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -Wall -Wcompat -Widentities -fhide-source-paths
build-depends:
MonadRandom
@ -122,7 +147,32 @@ executable PerfTestApp2
Paths_PerfTestApp2
hs-source-dirs:
src/
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
build-depends:
MonadRandom

View File

@ -1,10 +1,10 @@
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.33.0.
-- This file has been generated from package.yaml by hpack version 0.35.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 0b70d9c7ae836fba6b567e098aa3d2ec16331b36441b49fae2ce61bccf3e00c0
-- hash: bfd806c45b9bb22322a451a9022728ebaab8168a662bcc8b319ec87074b94dad
name: astro
version: 1.0.0.0
@ -51,7 +51,32 @@ library
Paths_astro
hs-source-dirs:
src
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -Wall -Wcompat -Widentities -fhide-source-paths
build-depends:
HUnit
@ -165,7 +190,32 @@ executable astro
Paths_astro
hs-source-dirs:
src/
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
build-depends:
HUnit
@ -258,7 +308,32 @@ test-suite functional-tests
Paths_astro
hs-source-dirs:
test/
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
HUnit

View File

@ -1,10 +1,10 @@
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.33.0.
-- This file has been generated from package.yaml by hpack version 0.35.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: f607560888323859c75863174809c88d92f57b47dc5396714d520812e1c7817c
-- hash: ed4c0703e5a47416b88c642125f219035545bdde7c1b16999d45d420b7b4cb61
name: labyrinth
version: 1.0.0.0
@ -40,7 +40,32 @@ library
Paths_labyrinth
hs-source-dirs:
src
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -Wall -Wcompat -Widentities -fhide-source-paths
build-depends:
MonadRandom
@ -137,7 +162,32 @@ executable labyrinth
Paths_labyrinth
hs-source-dirs:
src/
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
build-depends:
MonadRandom
@ -226,7 +276,32 @@ test-suite functional-tests
Paths_labyrinth
hs-source-dirs:
test/
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
HUnit

View File

@ -1,10 +1,10 @@
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.33.0.
-- This file has been generated from package.yaml by hpack version 0.35.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 9329fa0d97a5093eed7a97bf52a51f12aeefb147a42e0bcd1191685d0856d061
-- hash: 2952fe9827efcd1e2bafc719b76e8425978f595fc16189c36259f6aa5f2627f0
name: hydra-base
version: 1.1.0.0
@ -57,7 +57,32 @@ library
Paths_hydra_base
hs-source-dirs:
src
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -Wall
build-depends:
MonadRandom

View File

@ -1,10 +1,10 @@
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.33.0.
-- This file has been generated from package.yaml by hpack version 0.35.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 126b98dca77f3ee49ac8b8810350e872113b6117853d6cbb95a68aabe7048dc2
-- hash: bebc08227b438ff751501b3d36ec2eb798aeaeaee9c1e027fc3e2895b7e4e918
name: hydra-church-free
version: 1.1.0.0
@ -50,7 +50,32 @@ library
Paths_hydra_church_free
hs-source-dirs:
src
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -Wall
build-depends:
MonadRandom

View File

@ -1,10 +1,10 @@
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.33.0.
-- This file has been generated from package.yaml by hpack version 0.35.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 2ea681f61abccbf8a1e3fa8befdca99f67295f77ea5690a884cd04c6aabb6a69
-- hash: 5290b281457b185a92f2fcdfe7e8d1d3c2e63f37c89ced04c4a16c7d65e0ac48
name: hydra-free
version: 1.1.0.0
@ -83,7 +83,32 @@ library
hs-source-dirs:
src
test-framework
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -Wall
build-depends:
MonadRandom
@ -181,7 +206,32 @@ test-suite functional-tests
Paths_hydra_free
hs-source-dirs:
test
default-extensions: NoImplicitPrelude GADTs RankNTypes DeriveFunctor DeriveGeneric OverloadedStrings LambdaCase MultiParamTypeClasses ExplicitNamespaces TypeApplications ScopedTypeVariables TypeOperators TypeFamilies DataKinds FlexibleContexts FlexibleInstances PatternSynonyms PolyKinds DefaultSignatures ConstraintKinds NamedFieldPuns TupleSections ViewPatterns MultiWayIf RecordWildCards
default-extensions:
NoImplicitPrelude
GADTs
RankNTypes
DeriveFunctor
DeriveGeneric
OverloadedStrings
LambdaCase
MultiParamTypeClasses
ExplicitNamespaces
TypeApplications
ScopedTypeVariables
TypeOperators
TypeFamilies
DataKinds
FlexibleContexts
FlexibleInstances
PatternSynonyms
PolyKinds
DefaultSignatures
ConstraintKinds
NamedFieldPuns
TupleSections
ViewPatterns
MultiWayIf
RecordWildCards
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
MonadRandom

Binary file not shown.

View File

@ -30,7 +30,7 @@ instance D.DB CatalogueDB where
data MeteorEntity
instance D.DBEntity CatalogueDB MeteorEntity where
data KeyEntity MeteorEntity = MeteorKey Int
data KeyEntity MeteorEntity = MeteorKey Int32
deriving (Show, Eq, Ord)
data ValueEntity MeteorEntity = MeteorValue D.Meteor
deriving (Show, Eq, Ord, Generic, ToJSON, FromJSON)
@ -38,7 +38,7 @@ instance D.DBEntity CatalogueDB MeteorEntity where
toDBValue = D.toDBValueJSON
fromDBValue = D.fromDBValueJSON
instance D.AsKeyEntity MeteorEntity Int where
instance D.AsKeyEntity MeteorEntity Int32 where
toKeyEntity = MeteorKey
instance D.AsKeyEntity MeteorEntity D.Meteor where
@ -54,7 +54,7 @@ data MeteorsCountEntity
instance D.DBEntity CatalogueDB MeteorsCountEntity where
data KeyEntity MeteorsCountEntity = MeteorsCountKey String
deriving (Show, Eq, Ord)
data ValueEntity MeteorsCountEntity = MeteorsCountValue Int
data ValueEntity MeteorsCountEntity = MeteorsCountValue Int32
deriving (Show, Eq, Ord, Generic, ToJSON, FromJSON)
toDBKey (MeteorsCountKey k) = show k
toDBValue = D.toDBValueJSON
@ -63,7 +63,7 @@ instance D.DBEntity CatalogueDB MeteorsCountEntity where
instance D.AsKeyEntity MeteorsCountEntity String where
toKeyEntity _ = MeteorsCountKey "meteors_count"
instance D.AsValueEntity MeteorsCountEntity Int where
instance D.AsValueEntity MeteorsCountEntity Int32 where
toValueEntity = MeteorsCountValue
fromValueEntity _ (MeteorsCountValue v) = v
@ -71,8 +71,8 @@ instance D.AsValueEntity MeteorsCountEntity Int where
meteorsCountKey :: D.KeyEntity MeteorsCountEntity
meteorsCountKey = D.toKeyEntity ("" :: String)
toIdxBase :: Int -> String
toIdxBase :: Int32 -> String
toIdxBase = printf "%07d"
toMeteorEntityKey :: Int -> String
toMeteorEntityKey :: Int32 -> String
toMeteorEntityKey = ("0|" <>) . toIdxBase

View File

@ -11,19 +11,19 @@ import Data.Time.Clock (UTCTime)
type DateTime = UTCTime
data Coords = Coords
{ _azimuth :: Int
, _altitude :: Int
{ _azimuth :: Int32
, _altitude :: Int32
}
deriving (Show, Eq, Ord, Generic, ToJSON, FromJSON)
data Meteor' k = Meteor
{ _id :: k
, _size :: Int
, _mass :: Int
, _size :: Int32
, _mass :: Int32
, _coords :: Coords
, _timestamp :: DateTime
}
deriving (Show, Eq, Ord, Generic, ToJSON, FromJSON)
type RawMeteor = Meteor' ()
type Meteor = Meteor' Int
type Meteor = Meteor' Int32

View File

@ -8,11 +8,11 @@ import Database.Beam
import Data.Time.Clock (UTCTime)
data DBMeteorT f = DBMeteor
{ _id :: Columnar f Int
, _size :: Columnar f Int
, _mass :: Columnar f Int
, _azimuth :: Columnar f Int
, _altitude :: Columnar f Int
{ _id :: Columnar f Int32
, _size :: Columnar f Int32
, _mass :: Columnar f Int32
, _azimuth :: Columnar f Int32
, _altitude :: Columnar f Int32
, _timestamp :: Columnar f UTCTime
}
deriving (Generic, Beamable)
@ -24,7 +24,7 @@ type DBMeteorId = PrimaryKey DBMeteorT Identity
-- CREATE TABLE meteors (id INTEGER PRIMARY KEY AUTOINCREMENT, size INT NOT NULL, mass INT NOT NULL, azimuth INT NOT NULL, altitude INT NOT NULL, timestamp TIMESTAMP NULL);
instance Table DBMeteorT where
data PrimaryKey DBMeteorT f = DBMeteorId (Columnar f Int)
data PrimaryKey DBMeteorT f = DBMeteorId (Columnar f Int32)
deriving (Generic, Beamable)
primaryKey = DBMeteorId . _id

View File

@ -78,7 +78,7 @@ findMeteor conn = L.scenario $ L.runSafely $ do
getMeteor
:: D.SqlConn SQLite.SqliteM
-> Int
-> Int32
-> L.AppL (Either SqlDBException (Maybe Meteor))
getMeteor conn pkVal = L.scenario $ L.runSafely $ do
mbRow <- getRow conn
@ -88,7 +88,7 @@ getMeteor conn pkVal = L.scenario $ L.runSafely $ do
pure $ convertMeteor <$> mbRow
insertMeteorQuery
:: Int -> Int -> Int -> Int -> Int -> UTCTime
:: Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> UTCTime
-> L.SqlDBL SQLite.SqliteM ()
insertMeteorQuery meteorId size mass azmth alt time = do
let meteorDB :: CatDB.DBMeteor = CatDB.DBMeteor
@ -105,14 +105,14 @@ insertMeteorQuery meteorId size mass azmth alt time = do
-- Sample of autoincrement:
-- $ B.insertExpressions [ (B.val_ meteorDB) { CatDB._id = B.default_ } ]
insertMeteor :: D.SqlConn SQLite.SqliteM -> Int -> L.AppL (D.DBResult ())
insertMeteor :: D.SqlConn SQLite.SqliteM -> Int32 -> L.AppL (D.DBResult ())
insertMeteor conn meteorId
= L.scenario
$ L.evalSqlDB conn
$ insertMeteorQuery meteorId 100 100 100 100 (UTCTime (toEnum 1) (secondsToDiffTime 0))
deleteMeteor :: D.SqlConn SQLite.SqliteM -> Int -> L.AppL (D.DBResult ())
deleteMeteor :: D.SqlConn SQLite.SqliteM -> Int32 -> L.AppL (D.DBResult ())
deleteMeteor conn meteorId
= L.scenario
$ L.evalSqlDB conn