Skip to content

Database

database

Functionality for working with Notion databases.

Database(*args: Any, **kwargs: Any)

A Notion database.

This object always represents an original database, not a linked database.

API reference: https://developers.notion.com/docs/working-with-databases

cover: FileInfo | None property

Return the cover of this database as file.

description: Text property writable

Return the description of this database as rich text.

icon: FileInfo | Emoji | None property

Return the icon of this database as file or emoji.

is_db: bool property

Return whether the object is a database.

is_empty: bool property

Return whether the database is empty.

is_inline: bool property

Return whether the database is inline.

is_wiki: bool property

Return whether the database is a wiki.

schema: type[Schema] property writable

Schema of the database.

title: str | Text property writable

Return the title of this database as rich text.

url: str property

Return the URL of this database.

__bool__() -> bool

Overwrite default behaviour.

__len__() -> int

Return the number of pages in this database.

__repr__() -> str

__str__()

create_page(**kwargs) -> Page

Create a page with properties according to the schema within the corresponding database.

delete() -> Self

Delete this database.

fetch_all() -> View

Fetch all pages and return a view.

pydantic_model() -> BaseModel

Return a Pydantic model for this database.

query()

Query a (large) database for pages in a more specific way.

reload() -> Self

Reload this database.

restore() -> Self

Restore this database.

to_markdown() -> str

Return the content of this database as Markdown.