You want to fetch data coming from an SQL database, to display it in your WeWeb's website?

You're at the right place 👌

Let's follow this tutorial with me, it shouldn't be long 😉

Add the SQL plugin to your website

To fetch data coming from a database, you first need to add the SQL plugin to your site in WeWeb.

It's located in the "Data" tab 👇

Then, you'll have to add queries. Each query is an SQL query that returns some data from a database. You can have as many queries and databases as you want.

The screen to configure a query looks like this one once filled 👇

Here are all the fields you need to enter:

Client: your database client (MySQL, PostgreSQL, MSSQL, MariaDB, Oracle, Amazon Redshift)

Name: the name this query will have in WeWeb

Host: your DB host

Port: your DB port

Database: your database name on the server

User: the username that will be used to execute the query

Password: the user password that will be used to log with the previous user

Query: the SQL query that will be executed to fetch data

Display by: the field from elements returned by the query that WeWeb will use to display them in the editor

Then, feel free to add new queries, save them, wait for WeWeb to synchronize your data, and you're good to go 🚀

Now, time to do something with this data!

To bind some SQL data to a page element, follow this tutorial
Was this article helpful?
Thank you!