DB Connector Schema
Bubble DB Connector Types?
Last updated
Bubble DB Connector Types?
Last updated
Just as the DBML Schema lets you generate a visual diagram for the Bubble Types you have defined in your app, the DB Connector Schema let's you generate a diagram for your queries that are connected through Bubble's SQL Database Connector plugin (shown below).
If you are using the default Bubble SQL Database Connector you can generate a diagram for the return types that you specify in your queries. This allows you to see a visual representation of the "data models" that are available to your application from the connector. See the image below for an example of a query return type.
The DB Connector Schema is an element that shows up in your UI Builder toolbox as shown below.
Create a new page within your app and drag the element called "DB Connector Schema" onto the page. Note: This page should be a temporary page or an "admin" page that is not accessible to users of your app.That's it, you are ready to generate DBML! Run your app and view this page which you can accomplish by clicking "Preview" in the top right corner of your Bubble app.
You should end up with a page like shown below. It will have a button that says "Copy to Clipboard" and the DBML text below it.
Note: If some of your tables look missing or the text looks cutoff, you can adjust the element settings to allow the content to grow.
Click the "Copy to Clipboard" button (or select the text on the page and copy it to your clipboard manually.
Finally, navigate to and paste the contents of your clipboard into the left portion of the screen. Your query return types diagram will show up on the right side of the screen.