This pull request is including two commits
1: adding `db_postgres` insert_update support 2: adding new parameters to `usrloc` that are not changing the default behaviour.
I added both to the same PR to highlight that the usage of insert_update will be immediately available for `usrloc` with `db_postgres` and `db_mysql` (maybe others, the ones not supporting it will simply revert to normal insert) You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1044
-- Commit Summary --
* db_postgress: insert_update() with DO UPDATE * usrloc: adding params
-- File Changes --
M src/modules/db_postgres/db_postgres.c (1) M src/modules/db_postgres/db_postgres.h (2) M src/modules/db_postgres/km_dbase.c (216) M src/modules/db_postgres/km_dbase.h (15) M src/modules/db_postgres/km_pg_con.c (4) M src/modules/db_postgres/km_res.c (1) M src/modules/db_postgres/pg_mod.c (4) M src/modules/usrloc/doc/usrloc_admin.xml (42) M src/modules/usrloc/ucontact.c (16) M src/modules/usrloc/usrloc_mod.c (7) M src/modules/usrloc/usrloc_mod.h (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1044.patch https://github.com/kamailio/kamailio/pull/1044.diff
Is the new db_load parameter related to insert_update or somehow unrelated?
There is db_mode that somehow controls the relation with database and it feels it conflicts a bit with the new db_load for some of its values.
`db_load` is unrelated, it is useful when using `dmq_usrloc` sync because some contacts are duplicated in memory so in such case loading from the DB is not useful.
`db_load` by default will not change anything but if set to 0 will not load registers from the DB on start up. I did not want to add more `db_mode` because I would have needed to double them.
I could remove `db_load` from this PR if you want but do you have an alternative ?
I would prefer to have two pull requests, each for the two different features. In this way one or the other can be merged separately.
For example, the db_load addition may need to be adjusted to detect conflicts with db_mode, because db_mode=4 is supposed to only load from db.
ok I will create two and propose a solution for db_mode=4
Closed #1044.