napkin-backend-bigquery-2.0.0
Safe HaskellNone
LanguageGHC2024

Napkin.Run.BigQuery

Synopsis

Documentation

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 #

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.

newtype Dollars #

Constructors

Dollars 

Fields

Instances

Instances details
ToJSON Dollars # 
Instance details

Defined in Napkin.Run.BigQuery

Generic Dollars # 
Instance details

Defined in Napkin.Run.BigQuery

Associated Types

type Rep Dollars 
Instance details

Defined in Napkin.Run.BigQuery

type Rep Dollars = D1 ('MetaData "Dollars" "Napkin.Run.BigQuery" "napkin-backend-bigquery-2.0.0-FxSpdT7ICDUHnvab5tDdSh" 'True) (C1 ('MetaCons "Dollars" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unDollars") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Fixed E2))))

Methods

from :: Dollars -> Rep Dollars x #

to :: Rep Dollars x -> Dollars #

Num Dollars # 
Instance details

Defined in Napkin.Run.BigQuery

Real Dollars # 
Instance details

Defined in Napkin.Run.BigQuery

Show Dollars # 
Instance details

Defined in Napkin.Run.BigQuery

Eq Dollars # 
Instance details

Defined in Napkin.Run.BigQuery

Methods

(==) :: Dollars -> Dollars -> Bool #

(/=) :: Dollars -> Dollars -> Bool #

Ord Dollars # 
Instance details

Defined in Napkin.Run.BigQuery

type Rep Dollars # 
Instance details

Defined in Napkin.Run.BigQuery

type Rep Dollars = D1 ('MetaData "Dollars" "Napkin.Run.BigQuery" "napkin-backend-bigquery-2.0.0-FxSpdT7ICDUHnvab5tDdSh" 'True) (C1 ('MetaCons "Dollars" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unDollars") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Fixed E2))))

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

streamReq #

Arguments

:: 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.

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.

newtype DataSetLock #

Constructors

DataSetLock (MVar ()) 

Orphan instances

Backend BigQuery # 
Instance details

Methods

backendConnectionString :: BackendConn BigQuery -> ConnectionString #

backendExecute :: (MonadNapkin BigQuery m, RenderSql command BigQuery) => BackendConn BigQuery -> command -> m () #

backendQuery :: (MonadNapkin BigQuery m, RenderSql q BigQuery) => BackendConn BigQuery -> q -> m [Map Text Value] #

backendCheckTableExists :: MonadNapkin BigQuery m => BackendConn BigQuery -> Ref Table -> m Bool #

backendGetTableKind :: MonadNapkin BigQuery m => BackendConn BigQuery -> Ref Table -> m TableKind #

backendGetRelationSchema :: MonadNapkin BigQuery m => BackendConn BigQuery -> Ref Table -> Relation -> m [BackendSchemaField BigQuery] #

backendGetAnnotations :: MonadNapkin BigQuery m => BackendConn BigQuery -> Ref Table -> m TableAnnotations #

backendAnnotate :: MonadNapkin BigQuery m => BackendConn BigQuery -> Ref Table -> Annotation -> m () #

backendCreateAs :: (command ~ CreateRelation BigQuery, RenderSql command BigQuery, MonadNapkin BigQuery m) => BackendConn BigQuery -> command -> m () #

backendCreate :: (command ~ CreateTableSchema BigQuery, RenderSql command BigQuery, MonadNapkin BigQuery m) => BackendConn BigQuery -> command -> m () #

backendCopyTable :: (MonadNapkin BigQuery m, RenderSql DeleteRows BigQuery, RenderSql InsertInto BigQuery, RenderSql (CreateRelation BigQuery) BigQuery, Default (BackendMeta 'KindTable BigQuery)) => BackendConn BigQuery -> Ref Table -> Ref Table -> TableWriteStrategy -> m () #

backendDrop :: MonadNapkin BigQuery m => BackendConn BigQuery -> DropRelation -> m () #

backendInsertInto :: (command ~ InsertInto, RenderSql command BigQuery, MonadNapkin BigQuery m) => BackendConn BigQuery -> command -> m () #

backendRename :: MonadNapkin BigQuery m => BackendConn BigQuery -> RenameRelation -> m () #

backendListTables :: MonadNapkin BigQuery m => BackendConn BigQuery -> ListTables -> m (Set ListedTable) #

backendNormalize :: MonadNapkin BigQuery m => BackendConn BigQuery -> NormalizeTableNames -> m (Map (Ref Table) NormalizedTable) #

RunBackendConn BigQuery # 
Instance details

CSVImport BigQuery # 
Instance details

HasBackendSchemaField BigQuery # 
Instance details

HasBackendQueryStats BigQuery # 
Instance details

ToJSON (BackendQueryStats BigQuery) # 
Instance details

Monoid (BackendQueryStats BigQuery) # 
Instance details

Semigroup (BackendQueryStats BigQuery) # 
Instance details

Show (BackendSchemaField BigQuery) # 
Instance details

Show (BackendQueryStats BigQuery) # 
Instance details

Eq (BackendSchemaField BigQuery) # 
Instance details

Eq (BackendQueryStats BigQuery) # 
Instance details