yes this is a must. Even if its not BI directional and only one way from Wappler as Copy&Paste…
Have had the same issue multiple times, a simple ability to copy wouldn’t be so hard to implement I think.
Query builder implemented
Sorry I wasn’t clear enough, I meant the ability to copy the sql query! The custom query’s are great but I am talking about copying the regular query that is generated by the wappler UI.
This has actually become more complex since this year old post
previously a query wasdisplayed in teh query builder like this (sorry about quality, had to clip an old video)
Now it is very different in the way the parameters work
(sorry posted before finished)
This one looks fairly regular to me:
But yesthe P1: tags etc, I can understand that it’s become complex. But still useful to copy I think.
I agree that copy would be useful (i voted for it) , i doubt the simple copy suggested by Paul a year ago would suffice for most users, thats all i am trying to say
To view the query, you need to switch on ‘Debug’:
Then, you’ll be able to copy the query if you run the action file:
This doesn’t seem to work for all queries (eg not for paged queries, as far as I know). Also, you will see variables as in the example above - so you can’t simply paste the query somewhere and run the query.
If you want to copy/paste a query as it’s actually executed, you may be able to set this up - depending on your development setup. I use WAMP on a local machine, so I can see the MySQL query log and see exactly what queries are executed (and copy/paste them etc.). Very useful for debugging.
+1 for being able to copy/paste the query.
I often run into the situation where I start my query with a Database Query step.
And then I realise the options I need are not available and I need to switch it into a Database Custom Query step.
So I need to open the project folder, find then open the file of my server action, scroll down to the query, copy the query, come back to the server action panel, scroll down to the custom query step and paste…
This would be a nice small QoL iteration. And I’m pretty sure it’s a quick one.
Make the query output field selectable.
@george pretty please?
The query shown in the query builder is not the same as the one generated on the server. The one in Wappler only displays the query in ANSI SQL and not the SQL for the specific server.
Like for MS SQL to get the first 10 records you do
SELECT TOP 10 * FROM table
while in Wappler it shows
SELECT * FROM table LIMIT 10
The query is only there to give you an idea of what kind of query it will generate, on the server it is being translated in the correct SQL dialect. Copy/paste it from Wappler on your server will not always give the same result or can throw an error.
What about a button/icon to copy native query so we can paste in custom query?
The query is build within server connect, to get the query you need to call the server action. You get the query by using debug, it will return the query instead of executing it.
Oh I see. Is it working for nodejs? I haven’t been able to make debug work for any query built with nodejs model.
Good one, I believe it is missing there. Also NodeJS uses knex to build the queries on the server which generates different result then the SQL builder we have in PHP/ASP.
This has been implemented in Wappler 5.1.5