From 618ea2157133734ee9f575b72f50690a161016ea Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Wed, 7 Aug 2019 15:19:54 +0200 Subject: [PATCH] Row: Add GetFinalRows() --- configobject/objecttypes/actionurl/actionurl.go | 4 ++++ configobject/objecttypes/checkcommand/checkcommand.go | 4 ++++ .../checkcommandargument/checkcommandargument.go | 4 ++++ .../checkcommandcustomvar/checkcommandcustomvar.go | 4 ++++ .../checkcommand/checkcommandenvvar/checkcommandenvvar.go | 4 ++++ configobject/objecttypes/customvar/customvar.go | 4 ++++ configobject/objecttypes/endpoint/endpoint.go | 4 ++++ configobject/objecttypes/eventcommand/eventcommand.go | 4 ++++ .../eventcommandargument/eventcommandargument.go | 4 ++++ .../eventcommandcustomvar/eventcommandcustomvar.go | 4 ++++ .../eventcommand/eventcommandenvvar/eventcommandenvvar.go | 4 ++++ configobject/objecttypes/host/host.go | 4 ++++ configobject/objecttypes/host/hostcomment/hostcomment.go | 4 ++++ .../objecttypes/host/hostcustomvar/hostcustomvar.go | 4 ++++ .../objecttypes/host/hostdowntime/hostdowntime.go | 4 ++++ configobject/objecttypes/hostgroup/hostgroup.go | 4 ++++ .../hostgroup/hostgroupcustomvar/hostgroupcustomvar.go | 4 ++++ .../hostgroup/hostgroupmember/hostgroupmember.go | 4 ++++ configobject/objecttypes/iconimage/iconimage.go | 4 ++++ configobject/objecttypes/notesurl/notesurl.go | 4 ++++ configobject/objecttypes/notification/notification.go | 4 ++++ .../notificationcustomvar/notificationcustomvar.go | 4 ++++ .../notification/notificationuser/notificationuser.go | 4 ++++ .../notificationusergroup/notificationusergroup.go | 4 ++++ .../notificationcommand/notificationcommand.go | 4 ++++ .../notificationcommandargument.go | 4 ++++ .../notificationcommandcustomvar.go | 4 ++++ .../notificationcommandenvvar.go | 4 ++++ configobject/objecttypes/service/service.go | 4 ++++ .../objecttypes/service/servicecomment/servicecomment.go | 4 ++++ .../service/servicecustomvar/servicecustomvar.go | 4 ++++ .../service/servicedowntime/servicedowntime.go | 4 ++++ configobject/objecttypes/servicegroup/servicegroup.go | 4 ++++ .../servicegroupcustomvar/servicegroupcustomvar.go | 4 ++++ .../servicegroup/servicegroupmember/servicegroupmember.go | 4 ++++ configobject/objecttypes/timeperiod/timeperiod.go | 4 ++++ .../timeperiod/timeperiodcustomvar/timeperiodcustomvar.go | 4 ++++ .../timeperiodoverrideexclude.go | 4 ++++ .../timeperiodoverrideinclude.go | 4 ++++ .../{timeperiodoverrideinclude.go => timeperiodrange.go} | 4 ++++ configobject/objecttypes/user/user.go | 4 ++++ .../objecttypes/user/usercustomvar/usercustomvar.go | 4 ++++ configobject/objecttypes/usergroup/usergroup.go | 4 ++++ .../usergroup/usergroupcustomvar/usergroupcustomvar.go | 4 ++++ .../usergroup/usergroupmember/usergroupmember.go | 4 ++++ configobject/objecttypes/zone/zone.go | 4 ++++ connection/mysql.go | 8 ++++++++ connection/mysql_utils.go | 1 + 48 files changed, 193 insertions(+) rename configobject/objecttypes/timeperiod/timeperiodrange/{timeperiodoverrideinclude.go => timeperiodrange.go} (93%) diff --git a/configobject/objecttypes/actionurl/actionurl.go b/configobject/objecttypes/actionurl/actionurl.go index 966bbbfd..ec6cf57e 100644 --- a/configobject/objecttypes/actionurl/actionurl.go +++ b/configobject/objecttypes/actionurl/actionurl.go @@ -53,6 +53,10 @@ func (a *ActionUrl) SetId(id string) { a.Id = id } +func (a *ActionUrl) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{a}, nil +} + func init() { name := "action_url" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/checkcommand/checkcommand.go b/configobject/objecttypes/checkcommand/checkcommand.go index f5cc5d17..8c3d97ed 100644 --- a/configobject/objecttypes/checkcommand/checkcommand.go +++ b/configobject/objecttypes/checkcommand/checkcommand.go @@ -72,6 +72,10 @@ func (c *CheckCommand) SetId(id string) { c.Id = id } +func (c *CheckCommand) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "checkcommand" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/checkcommand/checkcommandargument/checkcommandargument.go b/configobject/objecttypes/checkcommand/checkcommandargument/checkcommandargument.go index c8200429..9e50ae37 100644 --- a/configobject/objecttypes/checkcommand/checkcommandargument/checkcommandargument.go +++ b/configobject/objecttypes/checkcommand/checkcommandargument/checkcommandargument.go @@ -82,6 +82,10 @@ func (c *CheckCommandArgument) SetId(id string) { c.Id = id } +func (c *CheckCommandArgument) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "checkcommand_argument" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/checkcommand/checkcommandcustomvar/checkcommandcustomvar.go b/configobject/objecttypes/checkcommand/checkcommandcustomvar/checkcommandcustomvar.go index 4c3d71d5..0d484fc7 100644 --- a/configobject/objecttypes/checkcommand/checkcommandcustomvar/checkcommandcustomvar.go +++ b/configobject/objecttypes/checkcommand/checkcommandcustomvar/checkcommandcustomvar.go @@ -55,6 +55,10 @@ func (c *CheckCommandCustomvar) SetId(id string) { c.Id = id } +func (c *CheckCommandCustomvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "checkcommand_customvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/checkcommand/checkcommandenvvar/checkcommandenvvar.go b/configobject/objecttypes/checkcommand/checkcommandenvvar/checkcommandenvvar.go index 7fc2743a..56b50e01 100644 --- a/configobject/objecttypes/checkcommand/checkcommandenvvar/checkcommandenvvar.go +++ b/configobject/objecttypes/checkcommand/checkcommandenvvar/checkcommandenvvar.go @@ -61,6 +61,10 @@ func (c *CheckCommandEnvvar) SetId(id string) { c.Id = id } +func (c *CheckCommandEnvvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "checkcommand_envvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/customvar/customvar.go b/configobject/objecttypes/customvar/customvar.go index b1bb9314..1148e963 100644 --- a/configobject/objecttypes/customvar/customvar.go +++ b/configobject/objecttypes/customvar/customvar.go @@ -59,6 +59,10 @@ func (c *Customvar) SetId(id string) { c.Id = id } +func (c *Customvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "customvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/endpoint/endpoint.go b/configobject/objecttypes/endpoint/endpoint.go index 25cbcc69..9193abf8 100644 --- a/configobject/objecttypes/endpoint/endpoint.go +++ b/configobject/objecttypes/endpoint/endpoint.go @@ -66,6 +66,10 @@ func (e *Endpoint) SetId(id string) { e.Id = id } +func (e *Endpoint) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{e}, nil +} + func init() { name := "endpoint" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/eventcommand/eventcommand.go b/configobject/objecttypes/eventcommand/eventcommand.go index 299c0bba..12eda7bc 100644 --- a/configobject/objecttypes/eventcommand/eventcommand.go +++ b/configobject/objecttypes/eventcommand/eventcommand.go @@ -72,6 +72,10 @@ func (c *EventCommand) SetId(id string) { c.Id = id } +func (c *EventCommand) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "eventcommand" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/eventcommand/eventcommandargument/eventcommandargument.go b/configobject/objecttypes/eventcommand/eventcommandargument/eventcommandargument.go index 99996dc8..474ac6f8 100644 --- a/configobject/objecttypes/eventcommand/eventcommandargument/eventcommandargument.go +++ b/configobject/objecttypes/eventcommand/eventcommandargument/eventcommandargument.go @@ -82,6 +82,10 @@ func (c *EventCommandArgument) SetId(id string) { c.Id = id } +func (c *EventCommandArgument) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "eventcommand_argument" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/eventcommand/eventcommandcustomvar/eventcommandcustomvar.go b/configobject/objecttypes/eventcommand/eventcommandcustomvar/eventcommandcustomvar.go index 58b794e9..27b8d8a3 100644 --- a/configobject/objecttypes/eventcommand/eventcommandcustomvar/eventcommandcustomvar.go +++ b/configobject/objecttypes/eventcommand/eventcommandcustomvar/eventcommandcustomvar.go @@ -55,6 +55,10 @@ func (c *EventCommandCustomvar) SetId(id string) { c.Id = id } +func (c *EventCommandCustomvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "eventcommand_customvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/eventcommand/eventcommandenvvar/eventcommandenvvar.go b/configobject/objecttypes/eventcommand/eventcommandenvvar/eventcommandenvvar.go index 49ca0afc..f9062df8 100644 --- a/configobject/objecttypes/eventcommand/eventcommandenvvar/eventcommandenvvar.go +++ b/configobject/objecttypes/eventcommand/eventcommandenvvar/eventcommandenvvar.go @@ -61,6 +61,10 @@ func (c *EventCommandEnvvar) SetId(id string) { c.Id = id } +func (c *EventCommandEnvvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "eventcommand_envvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/host/host.go b/configobject/objecttypes/host/host.go index de6bea14..ba6f40a4 100644 --- a/configobject/objecttypes/host/host.go +++ b/configobject/objecttypes/host/host.go @@ -168,6 +168,10 @@ func (h *Host) SetId(id string) { h.Id = id } +func (h *Host) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{h}, nil +} + func init() { name := "host" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/host/hostcomment/hostcomment.go b/configobject/objecttypes/host/hostcomment/hostcomment.go index 77716597..4d369f3e 100644 --- a/configobject/objecttypes/host/hostcomment/hostcomment.go +++ b/configobject/objecttypes/host/hostcomment/hostcomment.go @@ -83,6 +83,10 @@ func (h *HostComment) SetId(id string) { h.Id = id } +func (h *HostComment) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{h}, nil +} + func init() { name := "host_comment" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/host/hostcustomvar/hostcustomvar.go b/configobject/objecttypes/host/hostcustomvar/hostcustomvar.go index ccb5374c..4fc7ec93 100644 --- a/configobject/objecttypes/host/hostcustomvar/hostcustomvar.go +++ b/configobject/objecttypes/host/hostcustomvar/hostcustomvar.go @@ -55,6 +55,10 @@ func (c *HostCustomvar) SetId(id string) { c.Id = id } +func (h *HostCustomvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{h}, nil +} + func init() { name := "host_customvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/host/hostdowntime/hostdowntime.go b/configobject/objecttypes/host/hostdowntime/hostdowntime.go index 669efa4e..df8733c2 100644 --- a/configobject/objecttypes/host/hostdowntime/hostdowntime.go +++ b/configobject/objecttypes/host/hostdowntime/hostdowntime.go @@ -95,6 +95,10 @@ func (h *HostDowntime) SetId(id string) { h.Id = id } +func (h *HostDowntime) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{h}, nil +} + func init() { name := "host_downtime" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/hostgroup/hostgroup.go b/configobject/objecttypes/hostgroup/hostgroup.go index a56624b3..bfa519de 100644 --- a/configobject/objecttypes/hostgroup/hostgroup.go +++ b/configobject/objecttypes/hostgroup/hostgroup.go @@ -72,6 +72,10 @@ func (h *Hostgroup) SetId(id string) { h.Id = id } +func (h *Hostgroup) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{h}, nil +} + func init() { name := "hostgroup" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/hostgroup/hostgroupcustomvar/hostgroupcustomvar.go b/configobject/objecttypes/hostgroup/hostgroupcustomvar/hostgroupcustomvar.go index cfd7e0cc..23edd766 100644 --- a/configobject/objecttypes/hostgroup/hostgroupcustomvar/hostgroupcustomvar.go +++ b/configobject/objecttypes/hostgroup/hostgroupcustomvar/hostgroupcustomvar.go @@ -55,6 +55,10 @@ func (c *HostgroupCustomvar) SetId(id string) { c.Id = id } +func (h *HostgroupCustomvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{h}, nil +} + func init() { name := "hostgroup_customvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/hostgroup/hostgroupmember/hostgroupmember.go b/configobject/objecttypes/hostgroup/hostgroupmember/hostgroupmember.go index e70e70db..bcec5fca 100644 --- a/configobject/objecttypes/hostgroup/hostgroupmember/hostgroupmember.go +++ b/configobject/objecttypes/hostgroup/hostgroupmember/hostgroupmember.go @@ -55,6 +55,10 @@ func (h *HostgroupMember) SetId(id string) { h.Id = id } +func (h *HostgroupMember) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{h}, nil +} + func init() { name := "hostgroup_member" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/iconimage/iconimage.go b/configobject/objecttypes/iconimage/iconimage.go index 8ea28e05..77aebbf5 100644 --- a/configobject/objecttypes/iconimage/iconimage.go +++ b/configobject/objecttypes/iconimage/iconimage.go @@ -53,6 +53,10 @@ func (a *IconImage) SetId(id string) { a.Id = id } +func (a *IconImage) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{a}, nil +} + func init() { name := "icon_image" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/notesurl/notesurl.go b/configobject/objecttypes/notesurl/notesurl.go index 068fbdc1..b0af7047 100644 --- a/configobject/objecttypes/notesurl/notesurl.go +++ b/configobject/objecttypes/notesurl/notesurl.go @@ -53,6 +53,10 @@ func (a *NotesUrl) SetId(id string) { a.Id = id } +func (a *NotesUrl) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{a}, nil +} + func init() { name := "notes_url" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/notification/notification.go b/configobject/objecttypes/notification/notification.go index 05d9289c..ecdf6215 100644 --- a/configobject/objecttypes/notification/notification.go +++ b/configobject/objecttypes/notification/notification.go @@ -102,6 +102,10 @@ func (n *Notification) SetId(id string) { n.Id = id } +func (n *Notification) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{n}, nil +} + func init() { name := "notification" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/notification/notificationcustomvar/notificationcustomvar.go b/configobject/objecttypes/notification/notificationcustomvar/notificationcustomvar.go index 75e6ef5c..4ea92548 100644 --- a/configobject/objecttypes/notification/notificationcustomvar/notificationcustomvar.go +++ b/configobject/objecttypes/notification/notificationcustomvar/notificationcustomvar.go @@ -55,6 +55,10 @@ func (c *NotificationCustomvar) SetId(id string) { c.Id = id } +func (c *NotificationCustomvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "notification_customvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/notification/notificationuser/notificationuser.go b/configobject/objecttypes/notification/notificationuser/notificationuser.go index 06159775..1619cd72 100644 --- a/configobject/objecttypes/notification/notificationuser/notificationuser.go +++ b/configobject/objecttypes/notification/notificationuser/notificationuser.go @@ -55,6 +55,10 @@ func (n *NotificationUser) SetId(id string) { n.Id = id } +func (n *NotificationUser) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{n}, nil +} + func init() { name := "notification_user" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/notification/notificationusergroup/notificationusergroup.go b/configobject/objecttypes/notification/notificationusergroup/notificationusergroup.go index 3a318fb9..38336ee3 100644 --- a/configobject/objecttypes/notification/notificationusergroup/notificationusergroup.go +++ b/configobject/objecttypes/notification/notificationusergroup/notificationusergroup.go @@ -55,6 +55,10 @@ func (n *NotificationUsergroup) SetId(id string) { n.Id = id } +func (n *NotificationUsergroup) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{n}, nil +} + func init() { name := "notification_usergroup" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/notificationcommand/notificationcommand.go b/configobject/objecttypes/notificationcommand/notificationcommand.go index 93b97d00..905c66f4 100644 --- a/configobject/objecttypes/notificationcommand/notificationcommand.go +++ b/configobject/objecttypes/notificationcommand/notificationcommand.go @@ -72,6 +72,10 @@ func (c *NotificationCommand) SetId(id string) { c.Id = id } +func (c *NotificationCommand) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "notificationcommand" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/notificationcommand/notificationcommandargument/notificationcommandargument.go b/configobject/objecttypes/notificationcommand/notificationcommandargument/notificationcommandargument.go index 3007ab53..c3cf6bab 100644 --- a/configobject/objecttypes/notificationcommand/notificationcommandargument/notificationcommandargument.go +++ b/configobject/objecttypes/notificationcommand/notificationcommandargument/notificationcommandargument.go @@ -82,6 +82,10 @@ func (c *NotificationCommandArgument) SetId(id string) { c.Id = id } +func (c *NotificationCommandArgument) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "notificationcommand_argument" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/notificationcommand/notificationcommandcustomvar/notificationcommandcustomvar.go b/configobject/objecttypes/notificationcommand/notificationcommandcustomvar/notificationcommandcustomvar.go index f52fe36c..8e442504 100644 --- a/configobject/objecttypes/notificationcommand/notificationcommandcustomvar/notificationcommandcustomvar.go +++ b/configobject/objecttypes/notificationcommand/notificationcommandcustomvar/notificationcommandcustomvar.go @@ -55,6 +55,10 @@ func (c *NotificationCommandCustomvar) SetId(id string) { c.Id = id } +func (c *NotificationCommandCustomvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "notificationcommand_customvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/notificationcommand/notificationcommandenvvar/notificationcommandenvvar.go b/configobject/objecttypes/notificationcommand/notificationcommandenvvar/notificationcommandenvvar.go index ed1873ee..aa905d05 100644 --- a/configobject/objecttypes/notificationcommand/notificationcommandenvvar/notificationcommandenvvar.go +++ b/configobject/objecttypes/notificationcommand/notificationcommandenvvar/notificationcommandenvvar.go @@ -61,6 +61,10 @@ func (c *NotificationCommandEnvvar) SetId(id string) { c.Id = id } +func (c *NotificationCommandEnvvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "notificationcommand_envvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/service/service.go b/configobject/objecttypes/service/service.go index b857451f..935778f7 100644 --- a/configobject/objecttypes/service/service.go +++ b/configobject/objecttypes/service/service.go @@ -159,6 +159,10 @@ func (s *Service) SetId(id string) { s.Id = id } +func (s *Service) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{s}, nil +} + func init() { name := "service" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/service/servicecomment/servicecomment.go b/configobject/objecttypes/service/servicecomment/servicecomment.go index 888aa929..74871681 100644 --- a/configobject/objecttypes/service/servicecomment/servicecomment.go +++ b/configobject/objecttypes/service/servicecomment/servicecomment.go @@ -83,6 +83,10 @@ func (s *ServiceComment) SetId(id string) { s.Id = id } +func (s *ServiceComment) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{s}, nil +} + func init() { name := "service_comment" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/service/servicecustomvar/servicecustomvar.go b/configobject/objecttypes/service/servicecustomvar/servicecustomvar.go index 0f4bc6de..b03b02c8 100644 --- a/configobject/objecttypes/service/servicecustomvar/servicecustomvar.go +++ b/configobject/objecttypes/service/servicecustomvar/servicecustomvar.go @@ -55,6 +55,10 @@ func (c *ServiceCustomvar) SetId(id string) { c.Id = id } +func (c *ServiceCustomvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "service_customvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/service/servicedowntime/servicedowntime.go b/configobject/objecttypes/service/servicedowntime/servicedowntime.go index bfe2bfc9..f93b90e0 100644 --- a/configobject/objecttypes/service/servicedowntime/servicedowntime.go +++ b/configobject/objecttypes/service/servicedowntime/servicedowntime.go @@ -95,6 +95,10 @@ func (s *ServiceDowntime) SetId(id string) { s.Id = id } +func (s *ServiceDowntime) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{s}, nil +} + func init() { name := "service_downtime" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/servicegroup/servicegroup.go b/configobject/objecttypes/servicegroup/servicegroup.go index 6cc16e92..46f13e72 100644 --- a/configobject/objecttypes/servicegroup/servicegroup.go +++ b/configobject/objecttypes/servicegroup/servicegroup.go @@ -72,6 +72,10 @@ func (s *Servicegroup) SetId(id string) { s.Id = id } +func (s *Servicegroup) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{s}, nil +} + func init() { name := "servicegroup" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/servicegroup/servicegroupcustomvar/servicegroupcustomvar.go b/configobject/objecttypes/servicegroup/servicegroupcustomvar/servicegroupcustomvar.go index d8d19d0c..2e34409f 100644 --- a/configobject/objecttypes/servicegroup/servicegroupcustomvar/servicegroupcustomvar.go +++ b/configobject/objecttypes/servicegroup/servicegroupcustomvar/servicegroupcustomvar.go @@ -55,6 +55,10 @@ func (c *ServicegroupCustomvar) SetId(id string) { c.Id = id } +func (c *ServicegroupCustomvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "servicegroup_customvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/servicegroup/servicegroupmember/servicegroupmember.go b/configobject/objecttypes/servicegroup/servicegroupmember/servicegroupmember.go index 320b307c..b04fc931 100644 --- a/configobject/objecttypes/servicegroup/servicegroupmember/servicegroupmember.go +++ b/configobject/objecttypes/servicegroup/servicegroupmember/servicegroupmember.go @@ -55,6 +55,10 @@ func (s *ServicegroupMember) SetId(id string) { s.Id = id } +func (s *ServicegroupMember) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{s}, nil +} + func init() { name := "servicegroup_member" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/timeperiod/timeperiod.go b/configobject/objecttypes/timeperiod/timeperiod.go index 4326da56..784d90df 100644 --- a/configobject/objecttypes/timeperiod/timeperiod.go +++ b/configobject/objecttypes/timeperiod/timeperiod.go @@ -72,6 +72,10 @@ func (t *Timeperiod) SetId(id string) { t.Id = id } +func (t *Timeperiod) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{t}, nil +} + func init() { name := "timeperiod" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/timeperiod/timeperiodcustomvar/timeperiodcustomvar.go b/configobject/objecttypes/timeperiod/timeperiodcustomvar/timeperiodcustomvar.go index ea093e1c..ab37c704 100644 --- a/configobject/objecttypes/timeperiod/timeperiodcustomvar/timeperiodcustomvar.go +++ b/configobject/objecttypes/timeperiod/timeperiodcustomvar/timeperiodcustomvar.go @@ -55,6 +55,10 @@ func (c *TimeperiodCustomvar) SetId(id string) { c.Id = id } +func (c *TimeperiodCustomvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "timeperiod_customvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/timeperiod/timeperiodoverrideexclude/timeperiodoverrideexclude.go b/configobject/objecttypes/timeperiod/timeperiodoverrideexclude/timeperiodoverrideexclude.go index a5b4cf2d..93d3404f 100644 --- a/configobject/objecttypes/timeperiod/timeperiodoverrideexclude/timeperiodoverrideexclude.go +++ b/configobject/objecttypes/timeperiod/timeperiodoverrideexclude/timeperiodoverrideexclude.go @@ -55,6 +55,10 @@ func (t *TimeperiodOverrideExclude) SetId(id string) { t.Id = id } +func (t *TimeperiodOverrideExclude) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{t}, nil +} + func init() { name := "timeperiod_override_exclude" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/timeperiod/timeperiodoverrideinclude/timeperiodoverrideinclude.go b/configobject/objecttypes/timeperiod/timeperiodoverrideinclude/timeperiodoverrideinclude.go index d6f76ff4..5db4a7dd 100644 --- a/configobject/objecttypes/timeperiod/timeperiodoverrideinclude/timeperiodoverrideinclude.go +++ b/configobject/objecttypes/timeperiod/timeperiodoverrideinclude/timeperiodoverrideinclude.go @@ -55,6 +55,10 @@ func (t *TimeperiodOverrideInclude) SetId(id string) { t.Id = id } +func (t *TimeperiodOverrideInclude) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{t}, nil +} + func init() { name := "timeperiod_override_include" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/timeperiod/timeperiodrange/timeperiodoverrideinclude.go b/configobject/objecttypes/timeperiod/timeperiodrange/timeperiodrange.go similarity index 93% rename from configobject/objecttypes/timeperiod/timeperiodrange/timeperiodoverrideinclude.go rename to configobject/objecttypes/timeperiod/timeperiodrange/timeperiodrange.go index 4ebcb70e..b2b21de1 100644 --- a/configobject/objecttypes/timeperiod/timeperiodrange/timeperiodoverrideinclude.go +++ b/configobject/objecttypes/timeperiod/timeperiodrange/timeperiodrange.go @@ -58,6 +58,10 @@ func (t *TimeperiodRange) SetId(id string) { t.Id = id } +func (t *TimeperiodRange) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{t}, nil +} + func init() { name := "timeperiod_range" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/user/user.go b/configobject/objecttypes/user/user.go index 57eb1b08..aea944e3 100644 --- a/configobject/objecttypes/user/user.go +++ b/configobject/objecttypes/user/user.go @@ -93,6 +93,10 @@ func (u *User) SetId(id string) { u.Id = id } +func (u *User) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{u}, nil +} + func init() { name := "user" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/user/usercustomvar/usercustomvar.go b/configobject/objecttypes/user/usercustomvar/usercustomvar.go index d4745b0a..59e6260a 100644 --- a/configobject/objecttypes/user/usercustomvar/usercustomvar.go +++ b/configobject/objecttypes/user/usercustomvar/usercustomvar.go @@ -55,6 +55,10 @@ func (c *UserCustomvar) SetId(id string) { c.Id = id } +func (c *UserCustomvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "user_customvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/usergroup/usergroup.go b/configobject/objecttypes/usergroup/usergroup.go index 4c880664..eee8d617 100644 --- a/configobject/objecttypes/usergroup/usergroup.go +++ b/configobject/objecttypes/usergroup/usergroup.go @@ -72,6 +72,10 @@ func (u *Usergroup) SetId(id string) { u.Id = id } +func (u *Usergroup) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{u}, nil +} + func init() { name := "usergroup" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/usergroup/usergroupcustomvar/usergroupcustomvar.go b/configobject/objecttypes/usergroup/usergroupcustomvar/usergroupcustomvar.go index 66d58112..3a07b3dd 100644 --- a/configobject/objecttypes/usergroup/usergroupcustomvar/usergroupcustomvar.go +++ b/configobject/objecttypes/usergroup/usergroupcustomvar/usergroupcustomvar.go @@ -55,6 +55,10 @@ func (c *UsergroupCustomvar) SetId(id string) { c.Id = id } +func (c *UsergroupCustomvar) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{c}, nil +} + func init() { name := "usergroup_customvar" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/usergroup/usergroupmember/usergroupmember.go b/configobject/objecttypes/usergroup/usergroupmember/usergroupmember.go index 06ad554f..375026ec 100644 --- a/configobject/objecttypes/usergroup/usergroupmember/usergroupmember.go +++ b/configobject/objecttypes/usergroup/usergroupmember/usergroupmember.go @@ -55,6 +55,10 @@ func (u *UsergroupMember) SetId(id string) { u.Id = id } +func (u *UsergroupMember) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{u}, nil +} + func init() { name := "usergroup_member" ObjectInformation = configobject.ObjectInformation{ diff --git a/configobject/objecttypes/zone/zone.go b/configobject/objecttypes/zone/zone.go index c98eab03..f2481f6e 100644 --- a/configobject/objecttypes/zone/zone.go +++ b/configobject/objecttypes/zone/zone.go @@ -75,6 +75,10 @@ func (z *Zone) SetId(id string) { z.Id = id } +func (z *Zone) GetFinalRows() ([]connection.Row, error) { + return []connection.Row{z}, nil +} + func init() { name := "zone" ObjectInformation = configobject.ObjectInformation{ diff --git a/connection/mysql.go b/connection/mysql.go index bf100b61..48f0a896 100644 --- a/connection/mysql.go +++ b/connection/mysql.go @@ -623,6 +623,14 @@ func (dbw *DBWrapper) SqlBulkInsert(rows []Row, stmt *BulkInsertStmt) error { return nil } + finalRows := make([]Row, 0) + for _, r := range rows { + fr, _ := r.GetFinalRows() + finalRows = append(finalRows, fr...) + } + + rows = finalRows + DbBulkInserts.Inc() placeholders := make([]string, len(rows)) diff --git a/connection/mysql_utils.go b/connection/mysql_utils.go index 849cb008..5f4b2528 100644 --- a/connection/mysql_utils.go +++ b/connection/mysql_utils.go @@ -429,6 +429,7 @@ type Row interface { UpdateValues() []interface{} GetId() string SetId(id string) + GetFinalRows() ([]Row, error) } type RowFactory func() Row \ No newline at end of file