Forum Documentation Showcase Pricing Learn more

[New Free Plugin] Air Database Diagram


#21

OMG Really! Cant wait to try this out! It’s going to be a handy tool. Thanks very much!


#22

Loving this.

How did you get the table names and field names, or does it work off swagger or something?


#23

Hi @NigelG I pull the table names and field names from the application’s meta file. I could have as well pull it from the swagger.
This means if your application doesn’t expose a data api it won’t have any information to read for drawing the diagrams.

There is another way to get the field names of tables if the table name is given. In the plugin editor bubble provides a function called listProperties which will give you the field ids’ and types of a given table name.
So in my first implementation i was asking the user to specify the table names and then i will pull the field names automatically. The good thing about this approach was that even if the application was not exposing data api i could still pull the field names.
The only issue with this is that the field names are ids not the display name. When you create a table field bubble assigns it an id based on the name your provide. If you change a fieldname only the display name changes, the id remains the same. So if you try to parse the values return by listProperties and use as field names you’re likely going to see old changed field names.

I found getting the table names and fields from the meta file simpler and cleaner.

As for the relationships i simply used the field types. If a field’s type is a custom type i create a link between the primary and secondary table.


#24

Yes, I thought the meta was easier.

Have been trying to pull out the table names from the meta for quite some time, but they are in a list which makes doing it in Bubble somewhat tricker, assume you are doing it in javascript ?


#25

Yes I’m doing it in Javascript.
The meta content is a json so i parse it into a Javascript object.
From there it’s simple to pull all the details out looking at the meta structure.


#26

Hi @seanhoots,

Just ran across this. It looks great. Apparently though I’m doing something wrong because I get this error: Error

Here are my API settings:

Element:

Editor Link: https://bubble.is/page?type=page&name=database_design&id=dotrackcopy&tab=tabs-1

Can you help me with this?

Thanks,
George


#27

Hi,

Sorry if this is a stupid question (Still really new to this). Just wondering if you could help. Below is a what ‘Air Database’ produced. I have the ‘Day’ table connected to the ‘User’ table. Wanting to say a user has many days but it is not showing up on the ‘Air Database’ as a connection. I can’t understand why it is not showing. Have I set something up wrong? Any help would be much appreciated.

Thanks,


#28

I don’t see that the User table has a list of Days as appears to be the case for Infringement.

image

If list of Days is actually in the User table, perhaps there is a but in Air Database Diagram.


#29

Hi there , first thanks for this. But I’m getting different results, when set from left to right, and TOP to bottom which shows more.

And also when show fields is click I only get a question mark.

And by click in api I can see what the sect of data is linked to?

And also those box without and linking arrows means they are independent?correct