# SQL question about how Bubble make queries

**URL:** <https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940>\
**Category:** Questions\
**Created:** [December 28, 2022, 10:48pm UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940 "2022-12-28T22:48:51Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdwp.post](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mdwp.post/32/135205_2.png) [@mdwp.post](https://forum.bubble.io/u/mdwp.post)\
**Post date:** [December 28, 2022, 10:48pm UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/1 "2022-12-28T22:48:51Z")

</div>

Hey,  
Bubble fam. Does Bubble always make SQL queries like this “Select **all** from table x”? Even for a RG with only one field?

Cheers  
Meinolf

---

<div class="post-metadata">

**Author:** ![gazinhio](https://avatars.discourse-cdn.com/v4/letter/g/3ec8ea/32.png) [@gazinhio](https://forum.bubble.io/u/gazinhio)\
**Post date:** [December 29, 2022, 12:47pm UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/2 "2022-12-29T12:47:24Z")

</div>

Yes, it doesn’t make partial queries, it’s always the equivalent of ‘select \* from \<\>’. The only exception is when you’re using :grouped by where it only returns the grouped fields and the aggregated values eg sum, count etc.

---

<div class="post-metadata">

**Author:** ![bubble.trouble](https://avatars.discourse-cdn.com/v4/letter/b/7ba0ec/32.png) [@bubble.trouble](https://forum.bubble.io/u/bubble.trouble)\
**Post date:** [December 29, 2022, 2:07pm UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/3 "2022-12-29T14:07:40Z")

</div>

This actually isn’t true. If you use privacy rules the data is only returned for the fields you select. So in that sense it definitely isn’t “always” the equivalent of “select \*”.

---

<div class="post-metadata">

**Author:** ![mdwp.post](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mdwp.post/32/135205_2.png) [@mdwp.post](https://forum.bubble.io/u/mdwp.post)\
**Post date:** [December 29, 2022, 2:47pm UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/4 "2022-12-29T14:47:22Z")

</div>

Yep, otherwise privacy rules wouldn’t make any sense.  
But in **most** cases it is “select \*”

---

<div class="post-metadata">

**Author:** ![Kayami](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kayami/32/111689_2.png) [@Kayami](https://forum.bubble.io/u/Kayami)\
**Post date:** [December 29, 2022, 4:14pm UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/5 "2022-12-29T16:14:13Z")

</div>

the closest thing we have to real data about this is inspecting the HTTP requests on a page

we know that the cluser uses elasticsearch, from inspecting the HTTP traffic so that gives us some information on what tech is being used

you can see the entire response for the search, even if you use only one field in the repeating group - and we can see it is returning all the data for that record to the client (while respecting privacy rules)

 ![Screenshot 2022-12-29 at 17.11.19](https://us1.discourse-cdn.com/bubble/original/3X/e/6/e6c22f6f0a773c44b9aaed852bf5d179ec1f3ca2.jpeg)

---

<div class="post-metadata">

**Author:** ![mdwp.post](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mdwp.post/32/135205_2.png) [@mdwp.post](https://forum.bubble.io/u/mdwp.post)\
**Post date:** [December 29, 2022, 5:00pm UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/6 "2022-12-29T17:00:32Z")

</div>

How can privacy rules are respecting if we can see those fields in the inspector? 😱

---

<div class="post-metadata">

**Author:** ![lindsay\_knowcode](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/lindsay_knowcode/32/92967_2.png) [@lindsay\_knowcode](https://forum.bubble.io/u/lindsay_knowcode)\
**Post date:** [December 29, 2022, 5:18pm UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/7 "2022-12-29T17:18:15Z")

</div>

Something that isn’t talked about too much in Bubble is how the database schema (table names, column names, column types) is public information. Privacy Rules only protect the **data**.

---

<div class="post-metadata">

**Author:** ![ankur1](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@ankur1](https://forum.bubble.io/u/ankur1)\
**Post date:** [December 29, 2022, 7:14pm UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/8 "2022-12-29T19:14:49Z")

</div>

@lindsay_knowcode I don’t think so if you have privacy rules set up and only show 2 columns instead of all the columns. Bubble API will not fetch the hidden column as the key, if you are calling “DO search for”

---

<div class="post-metadata">

**Author:** ![bubble.trouble](https://avatars.discourse-cdn.com/v4/letter/b/7ba0ec/32.png) [@bubble.trouble](https://forum.bubble.io/u/bubble.trouble)\
**Post date:** [December 29, 2022, 8:53pm UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/9 "2022-12-29T20:53:27Z")

</div>

@ankur1 in this particular instance @lindsay_knowcode is correct.

---

<div class="post-metadata">

**Author:** ![paul34](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/paul34/32/159620_2.png) [@paul34](https://forum.bubble.io/u/paul34)\
**Post date:** [February 1, 2023, 11:09am UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/10 "2023-02-01T11:09:43Z")

</div>

I am trying to send you a private message, but can’t see homw? I saw your youtube channel

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [February 1, 2023, 11:43am UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/11 "2023-02-01T11:43:21Z")

</div>

> [@lindsay\_knowcode](#):
>
> Something that isn’t talked about too much in Bubble is how the database schema (table names, column names, column types) is public information. Privacy Rules only protect the **data**.

Not entirely true.

![image](https://us1.discourse-cdn.com/bubble/original/3X/4/d/4d5f6ae4268a840a440a79117c45dce1326e3138.png)

/meta will now only show you basic app data.

And even with the data api enabled, you only get ticked data endpoints not everything.

---

<div class="post-metadata">

**Author:** ![exception-rambler](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/exception-rambler/32/152704_2.png) [@exception-rambler](https://forum.bubble.io/u/exception-rambler)\
**Post date:** [February 1, 2023, 11:48am UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/12 "2023-02-01T11:48:27Z")

</div>

I have rooted out table schema of apps from places other than Swagger documentation before… i.e. with that checkbox ticked the schema can still be scraped from elsewhere, I _believe_ that to be the case anyhow

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [February 1, 2023, 11:53am UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/13 "2023-02-01T11:53:30Z")

</div>

Agreed. I thought it did provide everything. But now I am not so sure it does. Maybe it was a quiet update.

You can intercept calls in your Browser, but that doesn’t give you the whole schema.

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [February 1, 2023, 12:00pm UTC](https://forum.bubble.io/t/sql-question-about-how-bubble-make-queries/238940/14 "2023-02-01T12:00:14Z")

</div>

> [@Kayami](#):
>
> we know that the cluser uses elasticsearch, from inspecting the HTTP traffic so that gives us some information on what tech is being used

Although in this case, it just means that the Bubble database USED to be on Elastic, but now isn’t. And they are using the old endpoints to avoid migrating everything in the front end.
