/*
Package dbschema is used to keep the SQL schema up to date.

	func sqlProvider(dbName string, version int) (sql []byte, found bool) {
		// read an SQL file and return the contents
		return
	}

	upgrader := dbschema.NewUpgrader()
	upgrader.SetSqlCallback(sqlProvider)

	if err = upgrader.AddDatabase("127.0.0.1", 5432, "foo", "postgres", "password"); err != nil {
		panic(err)
	}

	if err = upgrader.Run(); err != nil {
		panic(err)
	}
*/
package dbschema

import (
	// External
	"github.com/jackc/pgx/v5/pgxpool"
)

// An upgrader verifies the schema for one or more databases and upgrades them if possible.
type Upgrader struct {
	schema      string
	databases   map[string]Database
	logCallback func(string, string)
	sqlCallback func(string, int) ([]byte, bool)
}

type Database struct {
	Host     string
	Port     int
	DbName   string
	Username string
	Password string

	db       *pgxpool.Pool
	upgrader *Upgrader
}

// vim: foldmethod=marker
