Database tables (Notion)

Uit De Vliegende Brigade
Versie door Jeroen Strompf (overleg | bijdragen) op 13 dec 2022 om 08:29 (→‎See also)
(wijz) ← Oudere versie | Huidige versie (wijz) | Nieuwere versie → (wijz)
Naar navigatie springen Naar zoeken springen

One of the major functionalities of Notion, is database tables, usually (and confusingly to me) just called databases (I use these two terms interchangeably). Thanks to this functionality, you can to a certain degree, create database-driven applications, including joins and filters - Quite exciting stuff!

Within Notion, there is also such a thing as a 'regular' 'static' table, like in e.g., LibreOffice Writer - Hence database table might not be such a bad name.

This is not just a database object

It seems that in Notion, no 'traditional application development object' exists just on its own. Everything seems to have been lumped together with something else into something hybrid, like a transition from a world of clear black-and-white concepts, to one of endlessly gray amorphous blobs. Database tables are no exception: No aspect of database tables seem to just exist as they are. Sometimes you may think that you see the real thing, but just when you think you got it by the tail, it turns out to be only an illusion.

One of the consequences of this seems to be, that I can't really relate concepts in Notion to concepts that I know already from elsewhere - I found it really hard to understand things in Notion. Naturally, a solution would be that I just let go of my pre-existing concepts of what databases or web applications look like, but does that really work?

But there's hope: once you know this, life may become bearable again. Or at least you may understand why in this article, everything seems to be murky - At least, that's why I wrote this introduction: Last time I looked up this article before writing this paragraph, I got annoyed that it doesn't discuss database concept within Notion just as they are, but only in relation to other stuff. Now I know. And it's ok.

Database tables live around pages

Probably the easiest introduction to Notion database tables, is that they live around pages. They come in two flavors:

  • Inline database tables are incorporated into existing pages
  • full-page database tables acts like subpages with only the database table. I prefer to call these standalone database tables.

See Inline & standalone database tables (Notion) for details.

Primary keys?

Notion doesn't use primary keys in the user interface - Not as a property, neither as an attribute of a property (or as an auto-increment field).

I am quite sure that Notion uses primary keys internally:

  • An example that hints at internal pks: You can link database tables, and identical rows do not get mixed up
  • The function id() to retrieve a unique identifier for stuff (row?) - That's quite like a pk
  • You can't build anything beyond very trivial databases without pk - So simple.
In this order line table, I can probably just delete the first property Orderline-ID, for it probably has no purpose here

Properties

Database properties (Notion)

Views

Database tables are created in conjunction with a view: A way to view the data, a bit like table view plus form view in Microsoft Access at once. See Database views (Notion) for details.

Can I have the raw table definition, please?

Can I see the 'raw database table definition'? Like Table view in Microsoft Access, or the table definition in MySQL?

No, you can't.

There seem to be no obvious or intended way to just see the table definition without a view around it. But there are some ways to get close to this:

Workspace export

This surely qualifies as workaround and I'm not even sure it contains an exhaustive definition of database tables: Make an export from a workspace and inspect it. The pane on the right is a subfolder of the stuff on the left

Table view

The table view or table database view seems to be the most basic no-frills view and hence the closest to a barebone table definition:

  • The specialist who created a system for me in Notion, seemed to regard these views as the closest thing to the raw table definition, and so do I
  • This is why I usually start with a table view, eventhough I probably well never use it - I do like to have it as backup, in case of complications
  • When you create a new database without specifying a view, you get this view.

For more: Database views (Notion).

Peek view

With the creation of a database table and its view, an additional so-called peek view gets created. A bit like a custom Edit view on a WooCommerce product:

  • It always gets created in the same way, regardless of the view that is specified at database creation
  • But it's really a view and not just a raw table representation, because you can change its presentation.
  • But the original peek view is preserved, so you can always get back to it - And that looks again a bit like a table definition representation.

For more: Peek view (Notion).

Can I see the properties of a database table?

Ehm, yes, you may see those:

View » Properties

This is probably the most reliable approach:

Go to a view » Properties

Peek view

Go to a field (in a regular view) » Peek view

Table view

Probably the least reliable approach, but easily available:

Through table view. When you don't have this view anymore, you can recreate it

Can I at least see all database tables with their name?

You want to see the names of the database tables? It seems that Notion really doesn't want you to do that. Especially the names of database tables seem to be shrouded in ambiguity:

Object browser

I found the sidebar object browser the most obvious place to look for the database names. They are indeed mentioned here (I don't know if that's always the case), but they have the same symbol as pages and that makes it tricky

Hoover over the name of a view

When I hoover over the name of the view, the tool tip says Table view of MyInlineDatabaseName

Link to an existing database

Go to a page » new block: Link existing database
Get an overview of all data objects. I don't know what the last item is. Maybe a leftover from earlier tests

URL encoded?

I think I read somewhere, that a database-ID is included in relevant URLs. Of course, that's not a title, but at least an identifier.

See also

Sources

Name of the database table?