-
-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package postgres | ||
|
||
import ( | ||
"github.com/jmoiron/sqlx" | ||
"github.com/prest/adapters/postgres/internal/connection" | ||
) | ||
|
||
// GetURI postgres connection URI | ||
func GetURI(DBName string) string { | ||
return connection.GetURI(DBName) | ||
} | ||
|
||
// Get get postgres connection | ||
func Get() (*sqlx.DB, error) { | ||
return connection.Get() | ||
} | ||
|
||
// GetPool of connection | ||
func GetPool() *connection.ConnectionPool { | ||
return GetPool() | ||
} | ||
|
||
// AddDatabaseToPool add connection to pool | ||
func AddDatabaseToPool(name string, DB *sqlx.DB) { | ||
connection.AddDatabaseToPool(name, DB) | ||
} | ||
|
||
// MustGet get postgres connection | ||
func MustGet() *sqlx.DB { | ||
return connection.MustGet() | ||
} | ||
|
||
// SetDatabase set current database in use | ||
func SetDatabase(name string) { | ||
connection.SetDatabase(name) | ||
} | ||
|
||
// GetDatabase get current database in use | ||
func GetDatabase() string { | ||
return connection.GetDatabase() | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters