DatabasesService class

Service for interacting with Notion Databases API

Constructors

DatabasesService(NotionHttpClient _httpClient)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addDataSource({required String databaseId, required List<Map<String, dynamic>> title, required Map<String, dynamic> properties}) Future
Adds a new data source to an existing database.
archive(String databaseId) Future<Database>
Archives a database by moving it to trash.
create({required Parent parent, required List<RichText> title, Map<String, dynamic>? properties, List<RichText>? description, PageIcon? icon, NotionFile? cover}) Future<Database>
Creates a new database.
getPrimaryDataSource(String databaseId) Future<DataSourceRef>
Gets the primary data source for a database.
isMultiSourceDatabase(String databaseId) Future<bool>
Checks if a database supports multiple data sources.
listDataSources({required String databaseId, String? startCursor, int? pageSize}) Future<Map<String, dynamic>>
Lists all data sources for a database.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query(String databaseId, {Map<String, dynamic>? filter, List<Map<String, dynamic>>? sorts, String? startCursor, int? pageSize, List<String>? filterProperties}) Future<PaginatedList<Page>>
Queries a database to retrieve pages that match the provided filter and sort criteria.
restore(String databaseId) Future<Database>
Restores a database from trash.
retrieve(String databaseId) Future<Database>
Retrieves a database by its ID.
toString() String
A string representation of this object.
inherited
update(String databaseId, {List<RichText>? title, List<RichText>? description, PageIcon? icon, NotionFile? cover, bool? isInline, bool? inTrash, bool? isLocked}) Future<Database>
Updates a database's attributes (title, description, icon, etc).

Operators

operator ==(Object other) bool
The equality operator.
inherited