Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Execute a Select query against the BigQuery REST API.
Synopsis
- data RecordSet = RecordSet {}
- newtype FieldNameText = FieldNameText Text
- data OutputValue
- = DecimalOutputValue Decimal
- | BigDecimalOutputValue BigDecimal
- | IntegerOutputValue Int64
- | FloatOutputValue Float64
- | GeographyOutputValue Geography
- | TextOutputValue Text
- | TimestampOutputValue Timestamp
- | DateOutputValue Date
- | TimeOutputValue Time
- | DatetimeOutputValue Datetime
- | BytesOutputValue Base64
- | BoolOutputValue Bool
- | ArrayOutputValue (Vector OutputValue)
- | RecordOutputValue (InsOrdHashMap FieldNameText OutputValue)
- | JsonOutputValue Value
- | NullOutputValue
- data ExecuteProblem
- data ShowDetails
- executeProblemMessage :: ShowDetails -> ExecuteProblem -> Text
- data Execute a
- data BigQuery = BigQuery {
- query :: Text
- parameters :: InsOrdHashMap ParameterName Parameter
- runExecute :: MonadIO m => BigQuerySourceConfig -> Execute (Job, RecordSet) -> m (Either ExecuteProblem (Job, RecordSet))
- executeSelect :: Select -> Execute (Job, RecordSet)
- streamBigQuery :: MonadIO m => BigQueryConnection -> BigQuery -> m (Either ExecuteProblem (Job, RecordSet))
- executeBigQuery :: MonadIO m => BigQueryConnection -> BigQuery -> m (Either ExecuteProblem ())
- deleteDataset :: (MonadError ExecuteProblem m, MonadIO m) => BigQueryConnection -> Text -> m ()
- insertDataset :: (MonadError ExecuteProblem m, MonadIO m) => BigQueryConnection -> Text -> m Dataset
Documentation
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.
newtype FieldNameText Source #
As opposed to BigQuery.FieldName which is a qualified name, this is just the unqualified text name itself.
Instances
data OutputValue Source #
Instances
data ExecuteProblem Source #
GetJobDecodeProblem String | |
CreateQueryJobDecodeProblem String | |
InsertDatasetDecodeProblem String | |
ExecuteRunBigQueryProblem BigQueryProblem | |
RESTRequestNonOK Status Value |
Instances
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.
Execute monad; as queries are performed, the record sets are stored in the map.
Instances
MonadIO Execute Source # | |
Defined in Hasura.Backends.BigQuery.Execute | |
Applicative Execute Source # | |
Functor Execute Source # | |
Monad Execute Source # | |
MonadError ExecuteProblem Execute Source # | |
Defined in Hasura.Backends.BigQuery.Execute throwError :: ExecuteProblem -> Execute a # catchError :: Execute a -> (ExecuteProblem -> Execute a) -> Execute a # |
BigQuery | |
|
runExecute :: MonadIO m => BigQuerySourceConfig -> Execute (Job, RecordSet) -> m (Either ExecuteProblem (Job, RecordSet)) Source #
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)
deleteDataset :: (MonadError ExecuteProblem m, MonadIO m) => BigQueryConnection -> Text -> m () Source #
Delete a dataset
insertDataset :: (MonadError ExecuteProblem m, MonadIO m) => BigQueryConnection -> Text -> m Dataset Source #
Insert a new dataset