@ -4,7 +4,7 @@ import (
"database/sql"
_ "github.com/go-sql-driver/mysql"
"log"
"mercury/src/ util "
"mercury/src/ db "
)
var (
@ -46,18 +46,18 @@ var (
== == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == * /
type InsightDBConnector struct {
* util . DBConnectorGeneric
* db . DBConnectorGeneric
}
func NewDBConnection ( ) * InsightDBConnector {
dbGeneric := util . DBConnectorGeneric { }
dbGeneric := db . DBConnectorGeneric { }
return & InsightDBConnector { & dbGeneric }
}
func ( c * InsightDBConnector ) UpdateTimeEntries ( entries * [ ] * InsightTimeEntry ) {
util . BulkUpdate [ InsightTimeEntry ] (
db . BulkUpdate [ InsightTimeEntry ] (
c . DBConnectorGeneric ,
util . InsightDatabaseName ,
db . InsightDatabaseName ,
"update-insight-timeEntry.sql" ,
entries ,
insightTimeEntryUpdateFunction ,
@ -65,9 +65,9 @@ func (c *InsightDBConnector) UpdateTimeEntries(entries *[]*InsightTimeEntry) {
}
func ( c * InsightDBConnector ) UpdateUsers ( users * [ ] * InsightUser ) {
util . BulkUpdate [ InsightUser ] (
db . BulkUpdate [ InsightUser ] (
c . DBConnectorGeneric ,
util . InsightDatabaseName ,
db . InsightDatabaseName ,
"update-insight-users.sql" ,
users ,
insightUserUpdateFunction ,
@ -75,18 +75,18 @@ func (c *InsightDBConnector) UpdateUsers(users *[]*InsightUser) {
}
func ( c * InsightDBConnector ) ReadUsers ( ) * [ ] * InsightUser {
return util . QueryForObjects [ InsightUser ] (
return db . QueryForObjects [ InsightUser ] (
c . DBConnectorGeneric ,
util . InsightDatabaseName ,
db . InsightDatabaseName ,
"read-insight-allUsers.sql" ,
insightUserMappingFunction ,
)
}
func ( c * InsightDBConnector ) ReadEngineerUsers ( ) * [ ] * InsightUser {
return util . QueryForObjects [ InsightUser ] (
return db . QueryForObjects [ InsightUser ] (
c . DBConnectorGeneric ,
util . InsightDatabaseName ,
db . InsightDatabaseName ,
"read-insight-engineerUsers.sql" ,
insightUserMappingFunction ,
)