The SQL Database Connector Plugin connects to databases and runs SQL queries from within Bubble. These queries can be triggered as actions, datasources (they show up as External APIs) or both. Bubble supports connecting to PostGres, MySQL and Microsoft SQL.
A connection should look like:
If there are special characters in the password, they must be URL-encoded, for instance replacing
%23. The rest of the encodings are listed here.
If the connection needs to be encrypted, e.g., with Microsoft Azure, add
?ssl=true to the connection.
Once a connection string is created, you can create queries that use it.
Any SQL statement is allowed, but for SELECT statements, you must add LIMIT N at the end, where N <= 100. Once you test and save the query, you can use it as an action, data source, or both, depending on how you configured it. Please note that a SELECT query returns a list, so when using it as the result of a previous step in a workflow, you must select a specific element by using :first item, :last item, etc.
(Have a suggested FAQ to help other Bubblers? Please email us at [email protected]!)