Skip to content

db.all() shows database as empty when it's not #457

Answered by msiemens
MrPigss asked this question in Q&A

You must be logged in to vote

Why don't we have to explicitly select the table we are working with?

Simply put, it's for historical reasons 🙂 The very first design of TinyDB had only a single table. Relatively quickly I found that I needed to store multiple tables within the same database so I added the possibility to create new tables. But, crucially, in my mind (back in 2013) I thought that most use cases would probably only use a single table and having to explicitly create a table when one doesn't need multiple tables felt like an unnecessary burden to me.

Now, almost 10 years later I agree that explicitly creating tables would indeed save a lot of confusion when people who used to use a single table start using…

Replies: 1 comment 1 reply

You must be logged in to vote
1 reply
@msiemens

Answer selected by MrPigss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants