RedQueryBuilder
RedQueryBuilder copied to clipboard
onTableChange is only fired when table[0] is changed, not on FK selection
- Select table1 from the table select. The callback shows table1 in filters[0]
- Add a condition and select a foreign key. onTableChange is not called
- Select table2 from the table select. The callback shows table2 and the FK_table from step2 in filters[0] & [1]
notes:
- If I save after step2 and reload, onTableChange will show both table1 and the FK_table
- You can also see that the table change growl notification is not fired on FK selection at http://redquerybuilder.appspot.com/
- I'm on Chrome Version 45.0.2454.93 (64-bit), on Mac 10.10.1
- I am interested in doing something similar to: http://stackoverflow.com/questions/21914192/select-clause-editing-in-redquerybuilder
Would it be really annoying to use SQL change event? ie cause too much work to be done by the client?
I'm not sure if this is a feature or a bug but wondering about what would work best for you while that sorts itself out.
I was thinking of SQL change or adding a listener on column select, but I'm not sure how to get at the tables other than brute force comparing selected columns to metadata to see if an FK was selected.
I think the new visitor stuff should be good for this. Just visit all the tables? I'll have a look/patch to add support for that if that sounds helpful to you?
That does sound like it could be good
Do you have any preference if the visitor visits each table filter in turn or visits a single "from" node and provides a sensible data structure? I think I'm most tempted by the former as it matches visiting lots of nodes in the where clause.
Whichever you think works best. Thanks.
http://savage.net.au/SQL/sql-92.bnf.html I think I will use for the node names/types for visiting.