ModifyInternalDataGroupRecords won't update Big-IP records when records list is empty
While using bigip.ModifyInternalDataGroupRecords() we encountered a possible issue.
The steps to reproduce it are as follows:
- There is only 1 record in a data group left;
- Executing ModifyInternalDataGroupRecords() with an empty slice results with success;
- Going to BIG-IP instance to check, the record is still there. For the BIG-IP system nothing is changed.
Reading the code and looking more specifically over the DataGroupRecord to dataGroupDTO structs, the Records field tag in dataGroupDTO is json:"records,omitempty". This leads to the behaviour described above. When passing empty/nil slice, the omitempty tag will remove the object from the json send to the BIG-IP system.
We are thinking of 2 possible solutions.
- Removing the
omitemptytag This will quickly solve the issue. As seen in the code, theModifyInternalDataGroupRecords()function is the only one modifying the DataGroupRecord resource. However, if another modifying function is introduced in the future, this removed tag, can lead to overwritten data group records in BIG-IP. - Distinguishing between nil slice records and empty slice records
This leads to modifying the
marshal()function and adding case for nil/empty slices. The downside of this approach is that distinguishing between empty and nil slice is a bad practise by a lot of clean code guides.
Please feel free to share your opinion and guidance how we can handle this behaviour. Whatever is decided, we can contribute it.
Yeah, developing a full-blown plugin for their IDEs would be great but is a super involved process. I think it's possible to use sublime text/atom highlighters there, so it should be good enough for now.
I think it's possible to use sublime text/atom highlighters there
I would love to, but i already made some research and didn't find how?
would love to know if its possible in 2022, would be great.
2023 plugin for intellij ;)?
I've found EdgeDB in an analysis phase, so I'm checking tiks if I can use it. Editor support (also IntelliJ) is one of those ticks and it's missing, for me quite a deal-breaker...
Search edgedb on the youtrack jetbrains and upvote my request for native support.
Upvote here
https://youtrack.jetbrains.com/issue/DBE-17080
The next version of intellij is going to have LSP support 🎉 https://blog.jetbrains.com/idea/2023/06/intellij-idea-2023-2-eap-7
I see that LSP support on EdgeDB roadmap is still listed as "post v1" but maybe this pushes the team over the... edge? 😎 (will delete pun in exchange for IDE support)
Would love this intellij is really catching up lately the new ui is finally getting solid, and it finally supports devcontainers. We need this schema function in intellij! The only reason i open vscode is the edgedb plugin
You can define custom file types for basic highlighting: https://www.jetbrains.com/help/idea/creating-and-registering-file-types.html#create-new-file-type
Line comment: # Support paired everything: enabled Keywords (probably some mistakes here):
1
aggregate
alter
and
any
commit
create
delete
detached
distinct
drop
else
empty
exists
false
filter
function
get
group
if
ilike
in
insert
is
like
limit
module
not
offset
or
order
over
partition
rollback
select
set
singleton
start
true
type
union
update
with
2
anycontiguous
anydiscrete
anyenum
anyfloat
anyint
anynumeric
anypoint
anyreal
anyscalar
anytype
array
bigint
bool
bytes
date_duration
datetime
decimal
document
duration
enum
float32
float64
int16
int32
int64
json
local_date
local_datetime
local_time
multirange
range
relative_duration
sequence
str
tuple
uuid
3
abstract
action
after
annotation
array
as
asc
atom
before
by
concept
constraint
database
desc
event
extending
final
first
for
from
index
initial
last
link
map
migration
multi
of
on
policy
property
rename
required
source
target
then
to
transaction
tuple
value
view
4
abs
adjacent
all
any
array_agg
array_fill
array_get
array_join
array_replace
array_unpack
assert
assert_distinct
assert_exists
assert_single
bit_and
bit_lshift
bit_not
bit_or
bit_rshift
bit_xor
bounded_above
bounded_below
bytes_get_bit
ceil
constraint
contains
count
date_get
datetime_current
datetime_get
datetime_of_statement
datetime_of_transaction
datetime_truncate
duration_get
duration_normalize_days
duration_normalize_hours
duration_to_seconds
duration_truncate
enumerate
exclusive
expression
find
floor
get_current_database
get_instance_name
get_transaction_isolation
get_version
get_version_as_str
json_array_unpack
json_get
json_object_pack
json_object_unpack
json_set
json_typeof
len
len_value
lg
ln
log
max
max_ex_value
max_len_value
max_value
mean
min
min_ex_value
min_len_value
min_value
multirange
multirange_unpack
one_of
overlaps
random
range
range_get_lower
range_get_upper
range_is_empty
range_is_inclusive_lower
range_is_inclusive_upper
range_unpack
re_match
re_match_all
re_replace
re_test
regexp
round
search
sequence_next
sequence_reset
sqrt
stddev
stddev_pop
str_lower
str_lpad
str_ltrim
str_pad_end
str_pad_start
str_repeat
str_replace
str_reverse
str_rpad
str_rtrim
str_split
str_title
str_trim
str_trim_end
str_trim_start
str_upper
strictly_above
strictly_below
sum
time_get
to_bigint
to_bytes
to_date_duration
to_datetime
to_decimal
to_duration
to_float32
to_float64
to_int16
to_int32
to_int64
to_json
to_local_date
to_local_datetime
to_local_time
to_relative_duration
to_str
uuid_generate_v1mc
uuid_generate_v4
var
var_pop
with_options
@KaelWD better than nothing. Thanks!
Anything we can config for some formatting?
Added scalar in 1 and overloaded in 3.
@KaelWD
You can define custom file types for basic highlighting: https://www.jetbrains.com/help/idea/creating-and-registering-file-types.html#create-new-file-type