MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / SQLDump

Method SQLDump

tools/mage/dev.go:108–118  ·  view source on GitHub ↗

SQLDump performs an SQL database dump of the dev database to the .cache folder.

()

Source from the content-addressed store, hash-verified

106
107// SQLDump performs an SQL database dump of the dev database to the .cache folder.
108func (Dev) SQLDump() error {
109 if mg.Verbose() {
110 fmt.Println("Saving sql database dump")
111 }
112 if err := os.MkdirAll(path.Join(".env", "cache"), 0o755); err != nil {
113 return err
114 }
115 return execDockerCompose("exec", "-T", "postgres",
116 "pg_dump", "-Fc", "-f", "/var/lib/ttn-lorawan/cache/database.pgdump", devDatabaseName,
117 )
118}
119
120// SQLRestore restores the dev database using a previously generated dump.
121func (Dev) SQLRestore() error {

Callers

nothing calls this directly

Calls 2

execDockerComposeFunction · 0.85
JoinMethod · 0.65

Tested by

no test coverage detected