-
Notifications
You must be signed in to change notification settings - Fork 0
/
export.go
32 lines (30 loc) · 920 Bytes
/
export.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package gnidump
import (
"github.com/gnames/gnidump/rebuild"
)
func (gnd GNIdump) PopulatePG() error {
// var err error
// log.Printf("Rebuilding '%s' database.\n", gnd.PgDB.PgDB)
// if err = gnd.ResetDB(); err != nil {
// return fmt.Errorf("reset of DB did not work: %w", err)
// }
// if err = gnd.Migrate(); err != nil {
// return fmt.Errorf("cannot rebuild DB schema: %w", err)
// }
rb := rebuild.NewRebuild(gnd.PgDB, gnd.InputDir, gnd.JobsNum)
// if err = gnsys.MakeDir(rb.ParserKeyValDir); err != nil {
// return err
// }
// if err = rb.UploadNameString(); err != nil {
// return fmt.Errorf("unable to populate name_strings table: %w", err)
// }
// if err = rb.UploadDataSources(); err != nil {
// return fmt.Errorf("unable to populate data_sources table: %w", err)
// }
//
// rb.UploadNameStringIndices()
// rb.RemoveOrphans()
// rb.CreateWords()
rb.VerificationView()
return nil
}