Problems editing database queries on SQL Server

Wappler Version : 6.8.0
Operating System : Windows 11
Server Model: node.js
Database Type: SQL Server
Hosting Type: AWS

Guys! Are you facing problems editing queries? It's quite annoying that Wappler keeps losing references to columns when there are joins and/or lefts! I'm wasting a lot of time having to redo the searches, because Wappler keeps reporting a loss of reference to fields that are fully available, so I have to close Wappler, reopen it and redo everything again, so it finds itself! But if I need to edit something, I have to redo it again and waste a lot of time unnecessarily! How are you with this?

I've been patiently trying to use the platform for a year and a half, I've made a lot of progress, but I'm losing patience with wasting time on simple activities, which really affects productivity and I'm looking for Wappler to increase productivity and not reduce it! Please, anyone else having this problem? Could it be because I'm using SQL Server and the query editor is not well configured for this DB?

in many cases, the editor include ".dbo.dbo", and a need remove to work!

image

1 Like

Hey maybe this can help:

1 Like

Also can you show some info? How is the schema and those queries?

wappler.zip (2.5 KB)

image

after erase the database page query and recreated it works, until next edit. And this looping keep going. this occurs normaly on queries that have join or lefts.

The log, throws something about limit and offset like:
A valid integer must be provided to offset
And
A valid integer must be provided to limit
Not sure how you get that
Also:
message: 'The multi-part identifier "dbo.usuarios.nome" could not be bound.',
It's related to join tables

Can you show your query?
Maybe I can reproduce it, but from memory never had issues..

Hey Alexandre,

You use a dot ( . ) in your table name?
dbo.usuarios

Avoid using dots in table or column names...
you better use an underscore ( _ ) :
dbo_usiarios

It's not very difficult to simulate this bug! It happened with other types of joins, but this one below is a classic error!

create a "users" table: (SQL SERVER, could be EXPRESS!)
"id" int (primary key)
"name" varchar
"idUserInclusao" int null (fk users)
"idUserAlteracao" int null (fk users)

try to make a database query, and make a join (LEFT) with the users table itself to get the name of the user who added the user.

Maybe the first time, it might work, but try again, change the query and include another join for the "idUserAlteracao" field and you might see the error!

i dont put ".dbo" on the name of table! the engine that put!!!

So, you're saying that you created a table "usuarios" and then wappler turned it into "dbo.usuarios"?

You created the tables via the database manager or externally?

All of your table names have that prefix "dbo" or just "usuarios"?

Yes, external (but schema updated), the editor put .dbo!

Have seen this on an old ASP .NET/MSSQL project that we have been working on lately.

When editing existing queries, built with some old Wappler version, Wappler adds this duplicate "dbo.dbo" schema in the JSON it creates for the query step. It was difficult to fix this from code view.
Only solution was to rebuild the query, and delete the old step.

We have seen this randomly on a NodeJS/Postgres application as well - where the schema "app" in our case gets added multiple times. But here, just editing the step from code view and removing duplicate schema does the trick.

tks @sid, but i already delete querie and rebuild, works, but after, whem editing again, the trouble come back :frowning: and i stay on looping!

Oh. Haven't seen that on my end. Maybe if you can restart Wappler with logs, something might be captured there.

the trouble are the engine put this prefix "dbo." and when resfreshing schema from db! and when editing the querie some times are put alone again another .dbo! There is some trouble to editing queries and/or when wappler read schema from db! on SQL SERVER!

the error occurs with more intensity when i tried edit queries that make join on table with the same table, like when i need a collumn on querie on the same table, like table of users, when a need save the id of the user creator (id on same table).

It's already there:

1 Like

Do we have official support for Wappler agents?? To solve this, I had to create an additional view unnecessarily.

We will check the issue and fix it in the next updates, after our summer break.