Safe Haskell | None |
---|---|
Language | GHC2024 |
Synopsis
- normalizeTableNames :: BQProjectId -> Set (Ref Table) -> Map (Ref Table) NormalizedTable
- bqGetAnnotations :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> GoogleEnv -> m TableAnnotations
- renderBigQuery :: TableWriteStrategy -> Text
- pattern MaxResults :: Word32
- exec :: forall a (scopes :: [Symbol]) m. (SatisfyScope (Scopes a) scopes, MonadIO m, GoogleRequest a, KnownScopes scopes) => Env scopes -> a -> m (Rs a)
- exec404 :: forall a (scopes :: [Symbol]) m e. (SatisfyScope (Scopes a) scopes, MonadIO m, GoogleRequest a, KnownScopes scopes) => e -> e -> Env scopes -> a -> m e
- getTableInfo :: MonadNapkin BigQuery m => GoogleEnv -> BQProjectId -> Ref Table -> m Table
- listTables :: MonadNapkin BigQuery m => GoogleEnv -> BQProjectId -> Prefix -> m (Set ListedTable)
- extractNormalized' :: BQProjectId -> Ref Table -> Either Text NormalizedTable
- extractNormalized :: BQProjectId -> Ref Table -> Either Text NormalizedTable
- bqValidator :: (SpecDependency -> Ref Table) -> SpecsDepsTables -> [WithSpecTable Text]
- newtype Dollars = Dollars {
- _unDollars :: Fixed E2
- calcBytesCost :: Int64 -> Dollars
- calcCost :: MonadNapkin BigQuery m => Job -> m Job
- executeQuery :: (MonadNapkin BigQuery m, RenderSql q BigQuery) => BQProjectId -> Labels -> q -> GoogleEnv -> m Job
- bqRunQuery :: (MonadNapkin BigQuery m, RenderSql q BigQuery) => BQProjectId -> Labels -> q -> GoogleEnv -> m [Map Text Value]
- jobQueryStats :: Job -> QueryStats BigQuery
- bqCopyTable :: MonadNapkin BigQuery m => BQProjectId -> Labels -> Ref Table -> Ref Table -> TableWriteStrategy -> GoogleEnv -> m ()
- bqObtainTableKind :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> GoogleEnv -> m TableKind
- bqAnnotateTable :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> Annotation -> GoogleEnv -> m ()
- runInsertJob :: (MonadNapkin BigQuery m, RenderSql a BigQuery) => JobInsertTableName -> BQProjectId -> Labels -> a -> TableMeta -> Ref Table -> GoogleEnv -> m Job
- bqCreateTableAs :: MonadNapkin BigQuery m => BQProjectId -> Labels -> Ref Table -> Query -> TableMeta -> GoogleEnv -> m ()
- authorizeView :: MonadNapkin BigQuery m => DataSetLocks -> BQProjectId -> Ref Table -> Set BQDataSetReference -> GoogleEnv -> m ()
- createTableDDL :: MonadNapkin BigQuery m => BQProjectId -> Labels -> CreateTableSchema BigQuery -> GoogleEnv -> m ()
- jobConfigurationQuery :: Text -> JobConfigurationQuery
- jobConfiguration :: GoogleEnv -> Labels -> JobConfiguration
- jobInsert :: BQProjectId -> JobConfiguration -> BigQueryJobsInsert
- bqGetRelationSchema :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> Relation -> GoogleEnv -> m [BackendSchemaField BigQuery]
- insertAndPollJob :: MonadNapkin BigQuery m => RetryPolicy -> BigQueryJobsInsert -> GoogleEnv -> NominalDiffTime -> BQProjectId -> m (Either (NonEmpty ErrorProto) Job)
- pollJob :: GoogleEnv -> NominalDiffTime -> BQProjectId -> JobReference -> IO (Either (NonEmpty ErrorProto) Job)
- bqDropTableOrView :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> GoogleEnv -> m ()
- bqCheckTableExists :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> GoogleEnv -> m Bool
- streamJobResultsPages :: forall (m :: Type -> Type) i. MonadResource m => GoogleEnv -> Job -> BQProjectId -> ConduitM i GetQueryResultsResponse m ()
- streamReq :: forall (m :: Type -> Type) req i. (MonadResource m, AllowRequest req BigQueryScopes) => GoogleEnv -> req -> Setter' req (Maybe Text) -> Getter (Rs req) (Maybe Text) -> ConduitM i (Rs req) m ()
- ndtMicros :: NominalDiffTime -> Int
- defDelay :: NominalDiffTime
- executePoll :: MonadNapkin BigQuery m => GoogleEnv -> BigQueryJobsInsert -> BQProjectId -> m Job
- tableInfo :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> m BigQueryTablesGet
- mkBigQueryEnvWithJsonCredentials :: (MonadCatch m, MonadNapkin BigQuery m) => Maybe Text -> CredentialsJson -> DbBackendOptions BigQuery -> BQProjectId -> m (BackendConn BigQuery)
- mkBigQueryEnvWithCredentials :: (MonadCatch m, MonadNapkin BigQuery m) => Maybe Text -> Credentials BigQueryScopes -> DbBackendOptions BigQuery -> BQProjectId -> m (BackendConn BigQuery)
- mkBigQueryEnv' :: (MonadCatch m, MonadIO m) => Natural -> IO GoogleEnv -> BQProjectId -> Labels -> m (BackendConn BigQuery)
- data BigQueryURI = BigQueryURI {}
- newtype DataSetLock = DataSetLock (MVar ())
- type DataSetLocks = TVar (Map BQDataSetId DataSetLock)
- getDataSetLock :: MonadIO m => DataSetLocks -> BQDataSetId -> m DataSetLock
- withDataSetLock :: MonadUnliftIO m => DataSetLock -> m a -> m a
- withDataSetLock' :: MonadUnliftIO m => DataSetLocks -> BQDataSetId -> m a -> m a
- parseBigQueryURI :: Text -> Maybe BigQueryURI
Documentation
normalizeTableNames :: BQProjectId -> Set (Ref Table) -> Map (Ref Table) NormalizedTable #
bqGetAnnotations :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> GoogleEnv -> m TableAnnotations #
pattern MaxResults :: Word32 #
exec :: forall a (scopes :: [Symbol]) m. (SatisfyScope (Scopes a) scopes, MonadIO m, GoogleRequest a, KnownScopes scopes) => Env scopes -> a -> m (Rs a) #
exec404 :: forall a (scopes :: [Symbol]) m e. (SatisfyScope (Scopes a) scopes, MonadIO m, GoogleRequest a, KnownScopes scopes) => e -> e -> Env scopes -> a -> m e #
getTableInfo :: MonadNapkin BigQuery m => GoogleEnv -> BQProjectId -> Ref Table -> m Table #
listTables :: MonadNapkin BigQuery m => GoogleEnv -> BQProjectId -> Prefix -> m (Set ListedTable) #
extractNormalized' :: BQProjectId -> Ref Table -> Either Text NormalizedTable #
BigQuery Names generally speaking have only three sections, subdivided by ".". Names cannot include a "." internally. But INFORMATION_SCHEMA views (read-only, system-defined views that provide metadata information about BigQuery objects) will have a "." in the name to demarcate. So there is an individual view called INFORMATION_SCHEMA.TABLES, one called INFORMATION_SCHEMA.VIEWS etc. If we wish to run against INFORMATION_SCHEMA views, we need to be a little clever in parsing them, allowing for the possibility that in fact two individual name segments actually are part of one view name.
extractNormalized :: BQProjectId -> Ref Table -> Either Text NormalizedTable #
bqValidator :: (SpecDependency -> Ref Table) -> SpecsDepsTables -> [WithSpecTable Text] #
Dollars | |
|
Instances
ToJSON Dollars # | |||||
Generic Dollars # | |||||
Defined in Napkin.Run.BigQuery
| |||||
Num Dollars # | |||||
Real Dollars # | |||||
Defined in Napkin.Run.BigQuery toRational :: Dollars -> Rational # | |||||
Show Dollars # | |||||
Eq Dollars # | |||||
Ord Dollars # | |||||
type Rep Dollars # | |||||
Defined in Napkin.Run.BigQuery |
calcBytesCost :: Int64 -> Dollars #
executeQuery :: (MonadNapkin BigQuery m, RenderSql q BigQuery) => BQProjectId -> Labels -> q -> GoogleEnv -> m Job #
bqRunQuery :: (MonadNapkin BigQuery m, RenderSql q BigQuery) => BQProjectId -> Labels -> q -> GoogleEnv -> m [Map Text Value] #
jobQueryStats :: Job -> QueryStats BigQuery #
bqCopyTable :: MonadNapkin BigQuery m => BQProjectId -> Labels -> Ref Table -> Ref Table -> TableWriteStrategy -> GoogleEnv -> m () #
bqObtainTableKind :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> GoogleEnv -> m TableKind #
bqAnnotateTable :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> Annotation -> GoogleEnv -> m () #
runInsertJob :: (MonadNapkin BigQuery m, RenderSql a BigQuery) => JobInsertTableName -> BQProjectId -> Labels -> a -> TableMeta -> Ref Table -> GoogleEnv -> m Job #
bqCreateTableAs :: MonadNapkin BigQuery m => BQProjectId -> Labels -> Ref Table -> Query -> TableMeta -> GoogleEnv -> m () #
authorizeView :: MonadNapkin BigQuery m => DataSetLocks -> BQProjectId -> Ref Table -> Set BQDataSetReference -> GoogleEnv -> m () #
createTableDDL :: MonadNapkin BigQuery m => BQProjectId -> Labels -> CreateTableSchema BigQuery -> GoogleEnv -> m () #
jobConfiguration :: GoogleEnv -> Labels -> JobConfiguration #
bqGetRelationSchema :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> Relation -> GoogleEnv -> m [BackendSchemaField BigQuery] #
insertAndPollJob :: MonadNapkin BigQuery m => RetryPolicy -> BigQueryJobsInsert -> GoogleEnv -> NominalDiffTime -> BQProjectId -> m (Either (NonEmpty ErrorProto) Job) #
Combines inserting a job and waiting for it to finish. If the job returns *only* server errors, which require retry, it will reenqueue and retry them as per the policy.
pollJob :: GoogleEnv -> NominalDiffTime -> BQProjectId -> JobReference -> IO (Either (NonEmpty ErrorProto) Job) #
Polls a job until it finishes
bqDropTableOrView :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> GoogleEnv -> m () #
bqCheckTableExists :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> GoogleEnv -> m Bool #
streamJobResultsPages :: forall (m :: Type -> Type) i. MonadResource m => GoogleEnv -> Job -> BQProjectId -> ConduitM i GetQueryResultsResponse m () #
:: forall (m :: Type -> Type) req i. (MonadResource m, AllowRequest req BigQueryScopes) | |
=> GoogleEnv | |
-> req | |
-> Setter' req (Maybe Text) | Request's page token |
-> Getter (Rs req) (Maybe Text) | Response's page token |
-> ConduitM i (Rs req) m () |
This probably belongs in gogol. Given an initial request and a way to get the response's next page token and set the requests next page token, repeatedly issue requests until pages run out.
ndtMicros :: NominalDiffTime -> Int #
executePoll :: MonadNapkin BigQuery m => GoogleEnv -> BigQueryJobsInsert -> BQProjectId -> m Job #
tableInfo :: MonadNapkin BigQuery m => BQProjectId -> Ref Table -> m BigQueryTablesGet #
mkBigQueryEnvWithJsonCredentials :: (MonadCatch m, MonadNapkin BigQuery m) => Maybe Text -> CredentialsJson -> DbBackendOptions BigQuery -> BQProjectId -> m (BackendConn BigQuery) #
mkBigQueryEnvWithCredentials :: (MonadCatch m, MonadNapkin BigQuery m) => Maybe Text -> Credentials BigQueryScopes -> DbBackendOptions BigQuery -> BQProjectId -> m (BackendConn BigQuery) #
mkBigQueryEnv' :: (MonadCatch m, MonadIO m) => Natural -> IO GoogleEnv -> BQProjectId -> Labels -> m (BackendConn BigQuery) #
Makes a BigQuery env, but with control over configuring how the Google environment is set up.
data BigQueryURI #
newtype DataSetLock #
DataSetLock (MVar ()) |
type DataSetLocks = TVar (Map BQDataSetId DataSetLock) #
getDataSetLock :: MonadIO m => DataSetLocks -> BQDataSetId -> m DataSetLock #
withDataSetLock :: MonadUnliftIO m => DataSetLock -> m a -> m a #
withDataSetLock' :: MonadUnliftIO m => DataSetLocks -> BQDataSetId -> m a -> m a #
parseBigQueryURI :: Text -> Maybe BigQueryURI #