Can't use global DB connection with validate step

Hey team,

I have a validate step that checks if an email address exists or not.

This was an old SC prior to globals being implemented, so the first step was the DB Connection step. I removed this, and then viewed the validate settings and I was unable to choose a DB for it to check/validate within.

Not creating a separate bug for this, since same problem as @mgaussie .

Validate data needs db added before validate step

But even if that is added I get the following error i console (all other db conn working fine)

message: “knex: Required configuration option ‘client’ is missing.”
stack: “Error: knex: Required configuration option ‘client’ is missing.↵ at new Client (/opt/node_app/node_modules/knex/lib/client.js:54:11)↵ at Knex (/opt/node_app/node_modules/knex/lib/knex.js:53:28)↵ at App.setDbConnection (/opt/node_app/lib/core/app.js:235:25)↵ at App.connect (/opt/node_app/lib/modules/dbconnector.js:8:14)↵ at App._exec (/opt/node_app/lib/core/app.js:417:57)↵ at App._exec (/opt/node_app/lib/core/app.js:388:28)↵ at App.exec (/opt/node_app/lib/core/app.js:357:20)↵ at App.define (/opt/node_app/lib/core/app.js:347:20)”
status: “500”

And, export validation still has a bug. Appends ‘public’ to file path:

Hey @namakemono you can probably overcome the client issue by changing this in the connection json, this solved that problem for me. For whatever reason it keeps defaulting to ‘type’.

My global connection works fine and says ‘client’.

Can not seem to find the config file for the specific Db connection needed before Validate step ?

1 Like

Cool. Another issue then

Wappler Version: 3.5.6
Server Modal: nodejs
Database Type: mysql
Target: Docker Local

Just to add on to confirm this, when you add validate without a database connection in the server action, you are not able to see the database in the validate list when using exists in database.

I was able to get around the issue by adding a database connection prior to the validate just like @namakemono, but received the same error as he did in the web developer console.

I received the same error as @namakemono when doing the export to form as well.

In reference to @mgaussie, suggestion regarding ‘client’ vs. ‘type’, the global database json says ‘client’.

The database connection added right before the validate did not have any database connection options other than to reference the global database.

Note, the server action works just fine without the validate option.

1 Like

the export validation bug for NodeJS is reported already:

Understandable, I can work around that one through importing from the client side for most validations.

I did not see the issue with the database reported anywhere other than this topic. I use the validate if not exists in database in 99% of my inserts/updates to prevent duplicates. The most prominent example being in the user registration process, so the validate component being able to interact with the database is essential for me. :slight_smile:

This has been fixed in Wappler 3.5.7

This topic was automatically closed after 47 hours. New replies are no longer allowed.