add comments

master
Oliver Tonnhofer 2013-10-29 15:11:58 +01:00
parent d387f3cd24
commit 5d3ab6cbcc
2 changed files with 3 additions and 0 deletions

View File

@ -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 {

View File

@ -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 {