---
description: Bubble DB Connector Types?
---

# DB Connector Schema

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).

<figure><img src="https://2267089811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAsHGvYicNpPP1P51BgJs%2Fuploads%2FuMWVxYapMhqV75HnDecw%2FScreenshot%202023-08-11%20at%203.50.21%20PM.png?alt=media&#x26;token=9e145de0-79f3-47aa-8681-068839ee33c3" alt=""><figcaption></figcaption></figure>

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.

<figure><img src="https://2267089811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAsHGvYicNpPP1P51BgJs%2Fuploads%2FN1nDWSoVCJ4zkPicwQcx%2FScreenshot%202023-08-11%20at%203.50.36%20PM.png?alt=media&#x26;token=3336042e-eaec-4436-afcd-fb36785f60b4" alt=""><figcaption></figcaption></figure>

The DB Connector Schema is an element that shows up in your UI Builder toolbox as shown below.

<figure><img src="https://2267089811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAsHGvYicNpPP1P51BgJs%2Fuploads%2FjwitLP7sQjlb9KvxvhcP%2FScreenshot%202023-08-11%20at%203.31.40%20PM.png?alt=media&#x26;token=4d35eb95-bc48-4200-a9cc-2f87c06edd44" alt=""><figcaption></figcaption></figure>

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.&#x20;

<figure><img src="https://2267089811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAsHGvYicNpPP1P51BgJs%2Fuploads%2FUlmvEQTPTHIVK4SC59eR%2FScreenshot%202023-08-11%20at%203.39.20%20PM.png?alt=media&#x26;token=0d97d8fc-8c38-4408-939d-b900bee56968" alt=""><figcaption></figcaption></figure>

**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.&#x20;

Finally, navigate to [https://dbdiagram.io/d](https://dbdiagram.io/d) 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.

