@@ -43,12 +43,12 @@ func TestGetMonitoredDatabases(t *testing.T) {
4343 conn .ExpectPing ()
4444 conn .ExpectQuery (`select \/\* pgwatch_generated \*\/` ).WillReturnRows (pgxmock .NewRows ([]string {
4545 "name" , "group" , "dbtype" , "connstr" , "config" , "config_standby" , "preset_config" ,
46- "preset_config_standby" , "is_superuser" , " include_pattern" , "exclude_pattern" ,
46+ "preset_config_standby" , "include_pattern" , "exclude_pattern" ,
4747 "custom_tags" , "host_config" , "only_if_master" , "is_enabled" ,
4848 }).AddRow (
4949 "db1" , "group1" , sources .Kind ("postgres" ), "postgres://user:pass@localhost:5432/db1" ,
5050 map [string ]float64 {"metric" : 60 }, map [string ]float64 {"standby_metric" : 60 }, "exhaustive" , "exhaustive" ,
51- true , ".*" , `\_.+` , map [string ]string {"tag" : "value" }, nil , true , true ,
51+ ".*" , `\_.+` , map [string ]string {"tag" : "value" }, nil , true , true ,
5252 ))
5353 pgrw , err := sources .NewPostgresSourcesReaderWriterConn (ctx , conn )
5454 a .NoError (err )
@@ -73,12 +73,12 @@ func TestSyncFromReader(t *testing.T) {
7373 conn .ExpectPing ()
7474 conn .ExpectQuery (`select \/\* pgwatch_generated \*\/` ).WillReturnRows (pgxmock .NewRows ([]string {
7575 "name" , "group" , "dbtype" , "connstr" , "config" , "config_standby" , "preset_config" ,
76- "preset_config_standby" , "is_superuser" , " include_pattern" , "exclude_pattern" ,
76+ "preset_config_standby" , "include_pattern" , "exclude_pattern" ,
7777 "custom_tags" , "host_config" , "only_if_master" , "is_enabled" ,
7878 }).AddRow (
7979 "db1" , "group1" , sources .Kind ("postgres" ), "postgres://user:pass@localhost:5432/db1" ,
8080 map [string ]float64 {"metric" : 60 }, map [string ]float64 {"standby_metric" : 60 }, "exhaustive" , "exhaustive" ,
81- true , ".*" , `\_.+` , map [string ]string {"tag" : "value" }, nil , true , true ,
81+ ".*" , `\_.+` , map [string ]string {"tag" : "value" }, nil , true , true ,
8282 ))
8383 pgrw , err := sources .NewPostgresSourcesReaderWriterConn (ctx , conn )
8484 a .NoError (err )
@@ -118,7 +118,6 @@ func TestUpdateDatabase(t *testing.T) {
118118 ConnStr : "postgres://user:pass@localhost:5432/db1" ,
119119 Metrics : map [string ]float64 {"metric" : 60 },
120120 MetricsStandby : map [string ]float64 {"standby_metric" : 60 },
121- IsSuperuser : true ,
122121 IncludePattern : ".*" ,
123122 ExcludePattern : `\_.+` ,
124123 CustomTags : map [string ]string {"tag" : "value" },
@@ -128,7 +127,7 @@ func TestUpdateDatabase(t *testing.T) {
128127 md .Name , md .Group , md .Kind ,
129128 md .ConnStr , `{"metric":60}` , `{"standby_metric":60}` ,
130129 md .PresetMetrics , md .PresetMetricsStandby ,
131- md .IsSuperuser , md . IncludePattern , md .ExcludePattern , `{"tag":"value"}` ,
130+ md .IncludePattern , md .ExcludePattern , `{"tag":"value"}` ,
132131 nil , md .OnlyIfMaster ,
133132 ).WillReturnResult (pgxmock .NewResult ("UPDATE" , 1 ))
134133
@@ -154,7 +153,6 @@ func TestWriteMonitoredDatabases(t *testing.T) {
154153 ConnStr : "postgres://user:pass@localhost:5432/db1" ,
155154 Metrics : map [string ]float64 {"metric" : 60 },
156155 MetricsStandby : map [string ]float64 {"standby_metric" : 60 },
157- IsSuperuser : true ,
158156 IncludePattern : ".*" ,
159157 ExcludePattern : `\_.+` ,
160158 CustomTags : map [string ]string {"tag" : "value" },
@@ -168,7 +166,7 @@ func TestWriteMonitoredDatabases(t *testing.T) {
168166 conn .ExpectExec (`insert into pgwatch\.source` ).WithArgs (
169167 md .Name , md .Group , md .Kind ,
170168 md .ConnStr , `{"metric":60}` , `{"standby_metric":60}` , md .PresetMetrics , md .PresetMetricsStandby ,
171- md .IsSuperuser , md . IncludePattern , md .ExcludePattern , `{"tag":"value"}` ,
169+ md .IncludePattern , md .ExcludePattern , `{"tag":"value"}` ,
172170 nil , md .OnlyIfMaster ,
173171 ).WillReturnResult (pgxmock .NewResult ("INSERT" , 1 ))
174172 conn .ExpectCommit ()
@@ -204,7 +202,7 @@ func TestWriteMonitoredDatabases(t *testing.T) {
204202 conn .ExpectExec (`insert into pgwatch\.source` ).WithArgs (
205203 md .Name , md .Group , md .Kind ,
206204 md .ConnStr , `{"metric":60}` , `{"standby_metric":60}` , md .PresetMetrics , md .PresetMetricsStandby ,
207- md .IsSuperuser , md . IncludePattern , md .ExcludePattern , `{"tag":"value"}` ,
205+ md .IncludePattern , md .ExcludePattern , `{"tag":"value"}` ,
208206 nil , md .OnlyIfMaster ,
209207 ).WillReturnError (errors .New ("failed insert" ))
210208 conn .ExpectRollback ()
0 commit comments