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: AnyFile | None property ¶
Return the cover of this database as file.
description: Text | None property writable ¶
Return the description of this database as rich text.
icon: AnyFile | Emoji | CustomEmoji | 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 writable ¶
Return whether the database is inline.
is_wiki: bool property ¶
Return whether the database is a wiki.
query: Query property ¶
Return a Query object to build and execute a database query.
schema: type[Schema] property writable ¶
Schema of the database.
title: str | Text | None 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__() -> str ¶
create_page(**kwargs: Any) -> Page ¶
Create a page with properties according to the schema within the corresponding database.
delete() -> Self ¶
Delete this database.
get_all_pages() -> View ¶
Retrieve all pages and return a view.
reload(*, rebind_schema: bool = True) -> Self ¶
Reload this database.
If rebind_schema is True, the schema will be rebound to the current database. Otherwise, the schema will set to the reflected schema of the current database.
restore() -> Self ¶
Restore this database.
to_markdown() -> str ¶
Return the reference to this database as Markdown.