BS4 Table Generator - Hello World

Ok, to the right of where that button is, there is a gear icon, click on that and then click on debug and then click on the arrow again to reopen the page.

The 500 means there is a server error, the debug will give us more information about the error. (usually)

Nope - added the debug option. and then opened the console window…

Ok, delete the server action view_cars by clicking on the X at in the Server Action menu in the top left hand corner.

Recreate it by first adding a database connection, then adding the database query.

Make sure the database query is named something other than db.

Save the results and then click on the Open in browser icon again.

If that does not work, we will look at your database directly. It may have to do with the server connect connections not being setup.

OK there are far too many similar labelling.

In API actions:
Steps:
database connection: db

The Connection Properties say
Name: db

One would assume that that name needs to match the name of the database that was initialized, namely: db.

I then create a database query but there is no linkage to the database db in the setup unless you click on the dropdown and the only option to select is “db”, which makes sense, given it is the only database I have defined.

For Database Query

Name: q_search_cars
Connect: db

Sounds good so far.

I then select the cars database in the Database Querry Builder
select all the fields and add them into the table

I then create a Server Connect give it a name sc_search_cars and I connect it to the search_cars API (api/search_cars).

Before doing that, click on the arrow in the folder in the server action panel on the left hand side to test the query to make sure it works.

If it does not work, we need to continue to troubleshoot.

What test querry.
And when I get to the generator I am back where I was when I started no data - no triangle by the data in the server connect window for the BS4 Table Generator

Step back a moment and ignore the server connection and the table generator for a moment.

Go back to the server action panel on the left hand side and click on the 6th icon, the one we clicked on earlier that opens the query in the browser.

If that still returns an error, then we need to check your database.

Same error 500

Ok, leave that as it is for now.

Click on the database icon (the fourth icon on the left) and then click on your database connection (named db in this case). Click on the properties box at the bottom to expand it.

You have shown that the direct database connection is working because you can see the tables and retrieve the data when you click on fetch data.

Click on Server Connect Connections and see if the information there matches what is in your Direct Database Connection.

Here is the difference. The Direct Database Connection creates well a direct database connection. That is how you see the tables and the data when you click on the database tab. The Server Connect Connections is what allows server connections to interact with the database. Both must be set up to make things work.

There is only a database “test” button for the Direct Database Connection. There is no test for the Server Side Database. And the Direct Database shows the connection is ok

Except for the port, you can leave the port alone.

I get that. and yes it does match - I think

Direct

Server

Don’t post them in here, but click on the little eye icon and make sure the passwords match.

Also, did you change anything in the server connect connections?

lol
Yes the passwords match. These are all defaults setup when the database is created.

Ok, so everything matches and you have not made any changes.

Close out any database connection pop ups that you currently have open.

Click on the Deploy button at the bottom.

Yes I have done that a few times

Development shows full green again.