You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/136
-- Commit Summary --
* db_text : simple raw support for select
-- File Changes --
M modules/db_text/dbt_base.c (45) M modules/db_text/dbtext.c (3) M modules/db_text/dbtext.h (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/136.patch https://github.com/kamailio/kamailio/pull/136.diff
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/136
How is this supposed to be used? The raw query is only the database table name?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/136#issuecomment-95272986
yes
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/136#issuecomment-95273202
Then what is the plan for the extensions to add selection of columns and where expresions? Going to build a custom query language?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/136#issuecomment-95274224
not a custom, just a minimal sql by parsing the const str* _s parameter
SELECT FIELDS FROM TABLE WHERE CONDITIONS UPDATE TABLE SET FIELDS=VALUES WHERE CONDITIONS DELETE FROM TABLE WHERE CONDITIONS
1) FIELDS => [FIELD, ...] 2) CONDITIONS [FIELD=VALUE, ...] 3) SET reuse (2)
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/136#issuecomment-95277309
Then I think it is better to use directly:
``` select * from tablename ```
instead current implementation, instead of just giving the table name. It is easy the check it starts with 'select * ' and then extract the table name as last token.
Also, the documentation of db_text will need to be extended with a new section about 'Raw Query' where to present what is implemented.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/136#issuecomment-95278991
sure, will do in the days to come just wanted to make sure this is useful for 4.3
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/136#issuecomment-95279439
We are freezing the development for 4.3 at the end of today.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/136#issuecomment-95279650
Merged #136.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/136#event-288038831