Document Your Xano Database with One Click!

Use Xano's free StateChange extension to export your database schema as DBML with one click, then paste it into dbdiagram.io to visualize tables, relationships, and fields. The free tier lets you publish live documentation and track schema changes without ever leaving Xano.
Chapters
Alright, so one of the really challenging things about building such a big and complicated backend in a tool like Xano is that of documentation. And, you know, Xano gives us some means of being able to sort of tag up how things are designed in our database, where we can see, you know, inside a given table, we'll say, okay, well, these are my access tokens, and maybe I'm able to see, you know, inside it, be able to get information about like what the settings are inside this instance ID, and this is going to be identity, ifier for the instance, or, you know, whatever it is, right? But the— but, but as we work on these things, uh, it sort of is locked up inside Xano, right? Um, and we start to create parallel documentation. So what we want to do is make it really easy for people to document, uh, their, uh, you know, their database structures. Uh, and there is a language for this, it's called DBML. So there is a database markup language out there which is you know, super handy for describing how a database works. Now, this is actually language agnostic. It's not particular to PostgreSQL or MS SQL or anything else. It's different from a database description language, which is what you would use to create a database from a set of instructions, but instead it's used for describing the database so we can understand what actually is working in here. And so if we were to go back over to our list of database tables, we could click here where it says generate DBML, which is part of the StateChange extension for Xano. And this is actually a free feature that you have access to. And you can choose whether or not you want to show or hide the IDs and table names. Like if you were to show them, then it'll always show like that 107 or 111 or whatever it is we have in here. And then we can click into the, you know, we have the DML output for the database and we can just click it and it will automatically copy it to the clipboard. There's just nothing more to it. And now I can go over to something like dbDiagrams, a service where it has a free tier where you sort of click here, go to app, they'll ask you to do a little bit of sign-in, whatever. I've got a paid account for what it's worth, and what I can do then is just backspace over all this, and then I can paste in exactly what came from my state change, and then it will show me the relationships among these tables and just have it in an environment which I can just go analyze it in greater detail. It will group them up using a class of all my circle tables that go together. They can be grouped together in a bit. And then I can also click into where I had access token here and be able to see that the access token is something I've now got inside my table. And all this gets built out in this DBML syntax that's also modifiable by you, of course, but then you can just keep up to date to put into here. Not only can you see it in this kind of graph and get them grouped up by using the tags, but you also can click where it says Publish to DB Docs, and you can make use of their service to get like this online documentation, which again is something they have as part of their free tier. So it's actually pretty handy. And if I— and then, you know, it will keep track of it as we go here. And you'll be able to see all the tables, all the documentation you set up for those tables, all of the notes you set up for keep track of those tables, all of the, the relationships that they might have in whatever schema you have. It'll keep track of the diagramming of it, and it will also keep track of the changelog. And this is really significant because if you are in the business of changing your database, you'll be able to keep track of what things have changed and been added as you go along, like what new tables have been created, what new, and what lines really have been changed in your DBML. This is handy, it is fast, and only requires one click once you're in here. So I hope that you hopefully you will check it out and try creating your own DBML and use the service you prefer for being able to read it out. dbdiagram.io has been perfectly handy for me. You may find others, but one way or the other, we get to document much, much, much, much, much, much faster just by using the features that already exist inside Xano and getting it out the door using the DBML and pushing a button.










