Heya Jorge! Thanks for the question. Types is a concept in Typescript. In the article, I have shown you different types of Bill data model, so those are types. It doesn't matter what db you are using, but if you're working in a Typescript project, you would be typing all the data models that you have, component props you receive, endpoint requests & responses etc.
For the case you mention about MongoDB not having a specific schema, in a Typescript project, it is even more important that you create a type for the document object that you store. There should be a base type, and at most there are other documents that have some extra fields, so for those fields you can mark them as optional in the type. That way you can get autocomplete intellisense & also type checking when you work with these data models, which is not present in plain JavaScript.
Jorge Romero
At first I was a little confused by what you meant by generating types from a database. I guess it's something particular to postgres or relational databases? I checked supabase's website and says it uses Postgres.
I only know how to use MongoDB. And the way it works is that I create the schema, and the implied type, on my app (with Mongoose ODM) and don't have to worry about how the database handles it. Because Mongo, being document-based, doesn't use any schema whatsoever.
Or perhaps I am just too naive and don't fully understand what you tried to do 😅