I’ve recently had a couple of times I tried out using Paged Database Queries in a server action.
Each time, I found that:
Some database fields that were
(a) listed in the query server action definition and
(b) shown in the output data being shown in Chrome Developer tools as passing through to the client side
Weren’t recognised by the Wappler client side, for example when referenced in a .where() function.
That if I changed the Database Query from being of type “Paged Records” to “Multiple Records” then paging information remained in the MySQL generated by the query (see screen shot below). There doesn’t appear any way to remove it again without re-building the query statement.
(I’m sorry that point (1) is a bit vague… I have a tight timescale I’m working to and decided not to spend any more time on trying to find out what was going on!)
If anyone can shine any light on what I experienced, or have had similar experiences I’d be really happy to hear about them… I don’t like to just give up on things!
Antony, what do you mean you don't use data picker? If you want to use the formatters use the data picker, don't try to code things you don't understand yourself!
Well Teodor, with a design as large as mine I have found the data picker too slow to use and the methods of making complex structures too difficult to understand. I also get muscle problems in my right hand if I use the mouse too much… so I would be unable to work any more by now if I’d use the data picker the whole way through my project!
I’ve created a huge project while using it very little so far.
And of course Wappler is designed to allow us to both use the data picker and type code. I thought that was one of the advantages of using Wappler!
But if you’d rather I work it out for myself with the data picker then I will do that.
I just thought with a short reply you could explain to me how the code is different!
You will inevitably run in to trouble then Antony as Teodor is pointing out to you. We can all hack code to fit and work (most of the time temporarily), but one day it will fail, and fail spectacularly (happened to me so many times thinking I know better). An update, a core change, something or other. The phrase RTFM is a common one, and for many reasons. I understand you want things to work but sometimes they won't, not as expected. Sometimes they do... But problems will arise you will have to deal with. Its not personal. Nor a reflection on your working methods. It is what it is my friend.
Thankfully I'm not in any trouble. Just curious why something didn't work out and asking our friendly forum for help... and now I know I need to go and research some new syntax so all is well!
It doesn’t work probably because something you are trying to do is not supported. Just because you think it should work does not make it so. The amount of times I have contacted George and Teodor with my hair brained ideas in the past is numerous. They tell in the most polite sense possible that I need to change what I do. Every time they have been absolutely correct. After all no one here knows Wappler better than these guys (Patrick obviously included).
Sorry mate I probably shouldn’t be filling your thread with this. Just thought it worth saying.
Dave, to continue with the hijacking of Antony’s thread (sorry Antony, but it was started due to concern for your wellbeing), is the Logitech mouse you mention a ‘vertical’ mouse? It looks like it, but it can be difficult to tell. I think these are really great for avoiding muscle/tendon problems. I have three mice on my desk, each able to control either the Mac or Windows computer so one would be enough, but I can’t decide which I prefer. If the Logitech mouse is similar (vertical) to what’s currently my favourite, then I might buy one. I recently bought a posh Logitch mouse, which looked ‘vertical’ but wasn’t (but it’s one of the three in use).
(To get back on topic..) I was puzzled to see this in your screenshot:
.. because I use paged queries a lot and have never seen this in the query preview. I then realised it's because I never hard-code these parameters in Server Connect. With a hard-coded offset of zero, your paged query is not going to have a very fulfilled life. Perhaps Wappler was upset by this and didn't manage the conversion to 'Multiple Records'. However, you don't need to re-build the query - just replace the hard-coded offset and limit values with GET parameters and I think it will convert correctly.
Thanks for your feedback Tom! Actually, that query is a really happy bunny... as it turns out I only really want it to return the first 10 rows and it does it very well!
I was just rather confused as to why it was still there when I had turned it back into a Multiple Records variant.
Maybe your hypothesis is correct, but I'll leave it as it is for now because "if it ain't broke, don't fix it!"
But I'll have a play around now I know how it all works...