napkin-0.5.9
Copyright(c) Soostone Inc 2020
LicenseAllRightsReserved
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Napkin.Spec.Dump

Description

dump Specs as dot or SQL files

Synopsis

Documentation

type Force = Bool #

specToSQLDir :: SpecToSQLDir b => RuntimeEnv -> b -> ValidatedInterpretedSpec b -> IncludeUnmanagedTables -> SqlFileType -> FilePath -> IO () #

Main entrypoint into SQL directory generation.

specGraphAsSQL :: (RenderSql (CreateTableAs d) b, RenderSql Query b, RenderSql CreateViewAs b, ParseSQL b, BackendTableMeta b ~ d, MustacheBackend b, ReifiesBackend b, IsBackendTableMeta b, RunBackendEffect b) => RuntimeEnv -> ExternMacros -> b -> SpecDepGraph -> SpecTableMap b -> GenerateInserts -> IO [(Ref Table, ([String], Maybe [String]))] #

Returns a list of SQL sources which can be used to construct the database in order of dependency.

data GenerateInserts #

Instances

Instances details
Default GenerateInserts # 
Instance details

Defined in Napkin.Spec.Dump

renderTableSpec :: forall b d. (RenderSql Query b, RenderSql CreateViewAs b, RenderSql (CreateTableAs d) b, ParseSQL b, BackendTableMeta b ~ d, MustacheBackend b, ReifiesBackend b, IsBackendTableMeta b, RunBackendEffect b) => RuntimeEnv -> ExternMacros -> b -> TableSpec b -> GenerateInserts -> IO ([String], Maybe [String]) #

Render a TableSpec using a BigQuery backend. Requires IO to perform Raw SQL file reading. GenerateInserts can indicate whether the generated SQL files should include INSERT statements. This is used for breaking up BigQuery statements which would otherwise be too long to execute.

Orphan instances