add comments
parent
d387f3cd24
commit
5d3ab6cbcc
|
@ -111,6 +111,7 @@ func (pg *PostGIS) createSchema(schema string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Init creates schema and tables, drops existing data.
|
||||
func (pg *PostGIS) Init() error {
|
||||
if err := pg.createSchema(pg.Schema); err != nil {
|
||||
return err
|
||||
|
@ -134,6 +135,7 @@ func (pg *PostGIS) Init() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// TableNames returns a list of all tables (without prefix).
|
||||
func (pg *PostGIS) TableNames() []string {
|
||||
var names []string
|
||||
for name, _ := range pg.Tables {
|
||||
|
|
|
@ -106,6 +106,7 @@ func dropTableIfExists(tx *sql.Tx, schema, table string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// rollbackIfTx rollsback transaction if tx is not nil.
|
||||
func rollbackIfTx(tx **sql.Tx) {
|
||||
if *tx != nil {
|
||||
if err := tx.Rollback(); err != nil {
|
||||
|
|
Loading…
Reference in New Issue