graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hasura.Backends.BigQuery.Execute

Description

Execute a Select query against the BigQuery REST API.

Synopsis

Documentation

data RecordSet Source #

A set of records produced by the database. These are joined together. There are all sorts of optimizations possible here, from using a matrix/flat vector, unboxed sums for Value, etc. Presently we choose a naive implementation in the interest of getting other work done.

Instances

Instances details
Show RecordSet Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

newtype FieldNameText Source #

As opposed to BigQuery.FieldName which is a qualified name, this is just the unqualified text name itself.

Constructors

FieldNameText Text 

Instances

Instances details
FromJSON FieldNameText Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

ToJSONKey FieldNameText Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

IsString FieldNameText Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Show FieldNameText Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Eq FieldNameText Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Ord FieldNameText Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Hashable FieldNameText Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

data OutputValue Source #

Instances

Instances details
ToJSON OutputValue Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Generic OutputValue Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Associated Types

type Rep OutputValue :: Type -> Type #

Show OutputValue Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Eq OutputValue Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Hashable OutputValue Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

type Rep OutputValue Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

type Rep OutputValue = D1 ('MetaData "OutputValue" "Hasura.Backends.BigQuery.Execute" "graphql-engine-1.0.0-inplace" 'False) ((((C1 ('MetaCons "DecimalOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Decimal)) :+: C1 ('MetaCons "BigDecimalOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BigDecimal))) :+: (C1 ('MetaCons "IntegerOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int64)) :+: C1 ('MetaCons "FloatOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Float64)))) :+: ((C1 ('MetaCons "GeographyOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Geography)) :+: C1 ('MetaCons "TextOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))) :+: (C1 ('MetaCons "TimestampOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Timestamp)) :+: C1 ('MetaCons "DateOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Date))))) :+: (((C1 ('MetaCons "TimeOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Time)) :+: C1 ('MetaCons "DatetimeOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Datetime))) :+: (C1 ('MetaCons "BytesOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Base64)) :+: C1 ('MetaCons "BoolOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool)))) :+: ((C1 ('MetaCons "ArrayOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Vector OutputValue))) :+: C1 ('MetaCons "RecordOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (InsOrdHashMap FieldNameText OutputValue)))) :+: (C1 ('MetaCons "JsonOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Value)) :+: C1 ('MetaCons "NullOutputValue" 'PrefixI 'False) (U1 :: Type -> Type)))))

data ExecuteProblem Source #

Instances

Instances details
ToJSON ExecuteProblem Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Generic ExecuteProblem Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Associated Types

type Rep ExecuteProblem :: Type -> Type #

MonadError ExecuteProblem Execute Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

type Rep ExecuteProblem Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

data ShowDetails Source #

We use this to hide certain details from the front-end, while allowing them in tests. We have not actually decided whether showing the details is insecure, but until we decide otherwise, it's probably best to err on the side of caution.

data Execute a Source #

Execute monad; as queries are performed, the record sets are stored in the map.

Instances

Instances details
MonadIO Execute Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Methods

liftIO :: IO a -> Execute a #

Applicative Execute Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Methods

pure :: a -> Execute a #

(<*>) :: Execute (a -> b) -> Execute a -> Execute b #

liftA2 :: (a -> b -> c) -> Execute a -> Execute b -> Execute c #

(*>) :: Execute a -> Execute b -> Execute b #

(<*) :: Execute a -> Execute b -> Execute a #

Functor Execute Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Methods

fmap :: (a -> b) -> Execute a -> Execute b #

(<$) :: a -> Execute b -> Execute a #

Monad Execute Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

Methods

(>>=) :: Execute a -> (a -> Execute b) -> Execute b #

(>>) :: Execute a -> Execute b -> Execute b #

return :: a -> Execute a #

MonadError ExecuteProblem Execute Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

data BigQuery Source #

Constructors

BigQuery 

Fields

Instances

Instances details
Show BigQuery Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Execute

streamBigQuery :: MonadIO m => BigQueryConnection -> BigQuery -> m (Either ExecuteProblem (Job, RecordSet)) Source #

TODO: WARNING: This function hasn't been tested on Big Data(tm), and therefore I was unable to get BigQuery to produce paginated results that would contain the JobResults field in the JSON response. Until that test has been done, we should consider this a preliminary implementation.

executeBigQuery :: MonadIO m => BigQueryConnection -> BigQuery -> m (Either ExecuteProblem ()) Source #

Execute a query without expecting any output (e.g. CREATE TABLE or INSERT)

insertDataset :: (MonadError ExecuteProblem m, MonadIO m) => BigQueryConnection -> Text -> m Dataset Source #

Insert a new dataset