mirror of
https://git.gibonuddevalla.se/go/dbschema.git
synced 2025-12-05 21:31:14 +01:00
Add a database instance without using connection details
This commit is contained in:
parent
b83c7b1e17
commit
825cf0fc9a
2 changed files with 8 additions and 0 deletions
|
|
@ -16,6 +16,10 @@ func newDatabase(host string, port int, dbName, user, pass string) (dbase Databa
|
|||
dbase.db, err = sql.Open("postgres", dbase.sqlConnString())
|
||||
return
|
||||
}// }}}
|
||||
func databaseFromInstance(db *sql.DB) (dbase Database, err error) {
|
||||
dbase.db = db
|
||||
return
|
||||
}
|
||||
|
||||
func (dbase Database) sqlConnString() string {// {{{
|
||||
return fmt.Sprintf(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue