We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 338a439 commit bb4a0beCopy full SHA for bb4a0be
1 file changed
go/mysql/utils.go
@@ -33,6 +33,15 @@ func (this *ReplicationLagResult) HasLag() bool {
33
return this.Lag > 0
34
}
35
36
+func GetDB(mysql_uri string) (*gosql.DB, error) {
37
+ db, err := gosql.Open("mysql", mysql_uri)
38
+ if err == nil {
39
+ return db, nil
40
+ } else {
41
+ return nil, err
42
+ }
43
+}
44
+
45
// GetReplicationLag returns replication lag for a given connection config; either by explicit query
46
// or via SHOW SLAVE STATUS
47
func GetReplicationLag(informationSchemaDb *gosql.DB, connectionConfig *ConnectionConfig) (replicationLag time.Duration, err error) {
0 commit comments