Matching on table definitions #22
Replies: 1 comment
-
Just merged #19 and kept the requirement for a label for map table definitions. I talked with a colleague to sanity check the ideas. The biggest thing that I realized today that I hadn't mentioned above: watchers need to provide trigger and function names in postgres. If we use a table_definition to create those names then there's a big question as to how we come up with a name that fits within PostgreSQL's limitations, is unique to the full map's configuration ( |
Beta Was this translation helpful? Give feedback.
-
So overall it seems like a bad idea to have users match on a complex object like the table definition map (i.e. the configuration option added in #18)
I gave this example of having different primary keys for the same table in #19, but my point was actually twofold:
But a better reason, in my mind, is options like
columns
/association_columns
. If you had these two watchers:You would need to disambiguate them be specifying all of the columns in the
columns
key, in order. And if you changed the columns in the watcher configuration (adding/removing/or shuffling), you need to find all of thehandle_info
s and fix them. It sounds like an easy thing, but it would be an easy thing to miss if you don't get everything just perfect. It's the sort of thing that seems like it might be handy / a general solution, but it leaves a lot of room for bugs that are easy to miss.Better, I think, to require creating a
label
which forces the developer to create a description of what they're trying to do with the watcher:Beta Was this translation helpful? Give feedback.
All reactions