Skip to content

Commit

Permalink
added error if field not indexed
Browse files Browse the repository at this point in the history
  • Loading branch information
agocorona committed Dec 7, 2019
1 parent fe49c7a commit ad2dfdb
Show file tree
Hide file tree
Showing 53 changed files with 395 additions and 197 deletions.
195 changes: 0 additions & 195 deletions Data/TCache/DefaultDefs.hs

This file was deleted.

6 changes: 5 additions & 1 deletion Data/TCache/IndexQuery.hs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ getIndexr :: (Queriable reg a)
getIndexr rindex val= do
mindex <- readDBRef rindex

let index = case mindex of Just (Index index) -> index; _ -> M.empty
let index = case mindex of
Just (Index index) -> index
_ -> do
let fields= show $ typeOf rindex
error $ "the index for "++ fields ++" do not exist. At main, use \"Data.TCache.IdexQuery.index\" to start indexing this field"

let dbrefs= case M.lookup val index of
Just dbrefs -> dbrefs
Expand Down
2 changes: 1 addition & 1 deletion TCache.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: TCache
version: 0.12.0
version: 0.12.2
cabal-version: >= 1.6
build-type: Simple
license: BSD3
Expand Down
Binary file added dist/build/Data/Persistent/Collection.dyn_hi
Binary file not shown.
Binary file added dist/build/Data/Persistent/Collection.dyn_o
Binary file not shown.
Binary file added dist/build/Data/Persistent/Collection.hi
Binary file not shown.
Binary file added dist/build/Data/Persistent/Collection.o
Binary file not shown.
Binary file added dist/build/Data/Persistent/IDynamic.dyn_hi
Binary file not shown.
Binary file added dist/build/Data/Persistent/IDynamic.dyn_o
Binary file not shown.
Binary file added dist/build/Data/Persistent/IDynamic.hi
Binary file not shown.
Binary file added dist/build/Data/Persistent/IDynamic.o
Binary file not shown.
Binary file added dist/build/Data/TCache.dyn_hi
Binary file not shown.
Binary file added dist/build/Data/TCache.dyn_o
Binary file not shown.
Binary file added dist/build/Data/TCache.hi
Binary file not shown.
Binary file added dist/build/Data/TCache.o
Binary file not shown.
Binary file added dist/build/Data/TCache/DefaultPersistence.dyn_hi
Binary file not shown.
Binary file added dist/build/Data/TCache/DefaultPersistence.dyn_o
Binary file not shown.
Binary file added dist/build/Data/TCache/DefaultPersistence.hi
Binary file not shown.
Binary file added dist/build/Data/TCache/DefaultPersistence.o
Binary file not shown.
Binary file added dist/build/Data/TCache/Defs.dyn_hi
Binary file not shown.
Binary file added dist/build/Data/TCache/Defs.dyn_o
Binary file not shown.
Binary file added dist/build/Data/TCache/Defs.hi
Binary file not shown.
Binary file added dist/build/Data/TCache/Defs.o
Binary file not shown.
Binary file added dist/build/Data/TCache/IResource.dyn_hi
Binary file not shown.
Binary file added dist/build/Data/TCache/IResource.dyn_o
Binary file not shown.
Binary file added dist/build/Data/TCache/IResource.hi
Binary file not shown.
Binary file added dist/build/Data/TCache/IResource.o
Binary file not shown.
Binary file added dist/build/Data/TCache/IndexQuery.dyn_hi
Binary file not shown.
Binary file added dist/build/Data/TCache/IndexQuery.dyn_o
Binary file not shown.
Binary file added dist/build/Data/TCache/IndexQuery.hi
Binary file not shown.
Binary file added dist/build/Data/TCache/IndexQuery.o
Binary file not shown.
Binary file added dist/build/Data/TCache/IndexText.dyn_hi
Binary file not shown.
Binary file added dist/build/Data/TCache/IndexText.dyn_o
Binary file not shown.
Binary file added dist/build/Data/TCache/IndexText.hi
Binary file not shown.
Binary file added dist/build/Data/TCache/IndexText.o
Binary file not shown.
Binary file added dist/build/Data/TCache/Memoization.dyn_hi
Binary file not shown.
Binary file added dist/build/Data/TCache/Memoization.dyn_o
Binary file not shown.
Binary file added dist/build/Data/TCache/Memoization.hi
Binary file not shown.
Binary file added dist/build/Data/TCache/Memoization.o
Binary file not shown.
Binary file added dist/build/Data/TCache/Triggers.dyn_hi
Binary file not shown.
Binary file added dist/build/Data/TCache/Triggers.dyn_o
Binary file not shown.
Binary file added dist/build/Data/TCache/Triggers.hi
Binary file not shown.
Binary file added dist/build/Data/TCache/Triggers.o
Binary file not shown.
50 changes: 50 additions & 0 deletions dist/build/autogen/Paths_TCache.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoRebindableSyntax #-}
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
module Paths_TCache (
version,
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where

import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude

#if defined(VERSION_base)

#if MIN_VERSION_base(4,0,0)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#else
catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a
#endif

#else
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#endif
catchIO = Exception.catch

version :: Version
version = Version [0,12,2] []
bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath

bindir = "/root/.cabal/bin"
libdir = "/root/.cabal/lib/x86_64-linux-ghc-8.4.2/TCache-0.12.2-BMoMHGzpnmeC7ODwXjoyvu"
dynlibdir = "/root/.cabal/lib/x86_64-linux-ghc-8.4.2"
datadir = "/root/.cabal/share/x86_64-linux-ghc-8.4.2/TCache-0.12.2"
libexecdir = "/root/.cabal/libexec/x86_64-linux-ghc-8.4.2/TCache-0.12.2"
sysconfdir = "/root/.cabal/etc"

getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
getBinDir = catchIO (getEnv "TCache_bindir") (\_ -> return bindir)
getLibDir = catchIO (getEnv "TCache_libdir") (\_ -> return libdir)
getDynLibDir = catchIO (getEnv "TCache_dynlibdir") (\_ -> return dynlibdir)
getDataDir = catchIO (getEnv "TCache_datadir") (\_ -> return datadir)
getLibexecDir = catchIO (getEnv "TCache_libexecdir") (\_ -> return libexecdir)
getSysconfDir = catchIO (getEnv "TCache_sysconfdir") (\_ -> return sysconfdir)

getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name)
Loading

0 comments on commit ad2dfdb

Please sign in to comment.