| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Notion.V1.Databases
Contents
Description
/v1/databases
Synopsis
- type DatabaseID = UUID
- data DatabaseObject = DatabaseObject {
- id :: DatabaseID
- createdTime :: POSIXTime
- lastEditedTime :: POSIXTime
- createdBy :: Maybe UserReference
- lastEditedBy :: Maybe UserReference
- title :: Vector RichText
- description :: Maybe (Vector RichText)
- properties :: Maybe (Map Text PropertySchema)
- icon :: Maybe Icon
- cover :: Maybe Cover
- url :: Text
- parent :: Parent
- isInline :: Maybe Bool
- inTrash :: Maybe Bool
- isLocked :: Maybe Bool
- publicUrl :: Maybe Text
- dataSources :: Vector DataSource
- object :: ObjectType
- data DataSource = DataSource {}
- newtype InitialDataSource = InitialDataSource {}
- data CreateDatabase = CreateDatabase {}
- data UpdateDatabase = UpdateDatabase {}
- data QueryDatabase = QueryDatabase {}
- type API = "databases" :> ((ReqBody '[JSON] CreateDatabase :> Post '[JSON] DatabaseObject) :<|> ((Capture "database_id" DatabaseID :> Get '[JSON] DatabaseObject) :<|> ((Capture "database_id" DatabaseID :> (ReqBody '[JSON] UpdateDatabase :> Patch '[JSON] DatabaseObject)) :<|> (Capture "database_id" DatabaseID :> ("query" :> (ReqBody '[JSON] QueryDatabase :> Post '[JSON] (ListOf PageObject)))))))
Main types
type DatabaseID = UUID Source #
Database ID
data DatabaseObject Source #
Notion database object
In API version 2025-09-03, database schema (properties) moved to data sources.
The properties field may be absent; use dataSources and the data source
endpoints to access schema information.
Constructors
| DatabaseObject | |
Fields
| |
Instances
data DataSource Source #
Data source reference within a database (API version 2025-09-03+)
Constructors
| DataSource | |
Instances
| Generic DataSource Source # | |||||
Defined in Notion.V1.Databases Associated Types
| |||||
| Show DataSource Source # | |||||
Defined in Notion.V1.Databases Methods showsPrec :: Int -> DataSource -> ShowS # show :: DataSource -> String # showList :: [DataSource] -> ShowS # | |||||
| FromJSON DataSource Source # | |||||
Defined in Notion.V1.Databases | |||||
| type Rep DataSource Source # | |||||
Defined in Notion.V1.Databases type Rep DataSource = D1 ('MetaData "DataSource" "Notion.V1.Databases" "notion-client-0.7.0.2-inplace" 'False) (C1 ('MetaCons "DataSource" 'PrefixI 'True) (S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UUID) :*: S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) | |||||
newtype InitialDataSource Source #
Initial data source configuration for database creation. Contains the property schema for the database's first data source.
Constructors
| InitialDataSource | |
Fields | |
Instances
| Generic InitialDataSource Source # | |||||
Defined in Notion.V1.Databases Associated Types
Methods from :: InitialDataSource -> Rep InitialDataSource x # to :: Rep InitialDataSource x -> InitialDataSource # | |||||
| Show InitialDataSource Source # | |||||
Defined in Notion.V1.Databases Methods showsPrec :: Int -> InitialDataSource -> ShowS # show :: InitialDataSource -> String # showList :: [InitialDataSource] -> ShowS # | |||||
| ToJSON InitialDataSource Source # | |||||
Defined in Notion.V1.Databases Methods toJSON :: InitialDataSource -> Value # toEncoding :: InitialDataSource -> Encoding # toJSONList :: [InitialDataSource] -> Value # toEncodingList :: [InitialDataSource] -> Encoding # omitField :: InitialDataSource -> Bool # | |||||
| type Rep InitialDataSource Source # | |||||
Defined in Notion.V1.Databases type Rep InitialDataSource = D1 ('MetaData "InitialDataSource" "Notion.V1.Databases" "notion-client-0.7.0.2-inplace" 'True) (C1 ('MetaCons "InitialDataSource" 'PrefixI 'True) (S1 ('MetaSel ('Just "properties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Text PropertySchema)))) | |||||
data CreateDatabase Source #
Create database request
In API version 2025-09-03, schema is specified via initialDataSource
rather than a top-level properties field.
Constructors
| CreateDatabase | |
Instances
| Generic CreateDatabase Source # | |||||
Defined in Notion.V1.Databases Associated Types
Methods from :: CreateDatabase -> Rep CreateDatabase x # to :: Rep CreateDatabase x -> CreateDatabase # | |||||
| Show CreateDatabase Source # | |||||
Defined in Notion.V1.Databases Methods showsPrec :: Int -> CreateDatabase -> ShowS # show :: CreateDatabase -> String # showList :: [CreateDatabase] -> ShowS # | |||||
| ToJSON CreateDatabase Source # | |||||
Defined in Notion.V1.Databases Methods toJSON :: CreateDatabase -> Value # toEncoding :: CreateDatabase -> Encoding # toJSONList :: [CreateDatabase] -> Value # toEncodingList :: [CreateDatabase] -> Encoding # omitField :: CreateDatabase -> Bool # | |||||
| type Rep CreateDatabase Source # | |||||
Defined in Notion.V1.Databases type Rep CreateDatabase = D1 ('MetaData "CreateDatabase" "Notion.V1.Databases" "notion-client-0.7.0.2-inplace" 'False) (C1 ('MetaCons "CreateDatabase" 'PrefixI 'True) ((S1 ('MetaSel ('Just "parent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Parent) :*: (S1 ('MetaSel ('Just "title") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector RichText)) :*: S1 ('MetaSel ('Just "initialDataSource") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe InitialDataSource)))) :*: ((S1 ('MetaSel ('Just "icon") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Icon)) :*: S1 ('MetaSel ('Just "cover") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Cover))) :*: (S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector RichText))) :*: S1 ('MetaSel ('Just "isInline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))))) | |||||
data UpdateDatabase Source #
Update database request
In API version 2025-09-03, schema updates (properties) are handled via
the Update Data Source API (UpdateDataSource).
This endpoint only handles database-level attributes.
Constructors
| UpdateDatabase | |
Instances
| Generic UpdateDatabase Source # | |||||
Defined in Notion.V1.Databases Associated Types
Methods from :: UpdateDatabase -> Rep UpdateDatabase x # to :: Rep UpdateDatabase x -> UpdateDatabase # | |||||
| Show UpdateDatabase Source # | |||||
Defined in Notion.V1.Databases Methods showsPrec :: Int -> UpdateDatabase -> ShowS # show :: UpdateDatabase -> String # showList :: [UpdateDatabase] -> ShowS # | |||||
| ToJSON UpdateDatabase Source # | |||||
Defined in Notion.V1.Databases Methods toJSON :: UpdateDatabase -> Value # toEncoding :: UpdateDatabase -> Encoding # toJSONList :: [UpdateDatabase] -> Value # toEncodingList :: [UpdateDatabase] -> Encoding # omitField :: UpdateDatabase -> Bool # | |||||
| type Rep UpdateDatabase Source # | |||||
Defined in Notion.V1.Databases type Rep UpdateDatabase = D1 ('MetaData "UpdateDatabase" "Notion.V1.Databases" "notion-client-0.7.0.2-inplace" 'False) (C1 ('MetaCons "UpdateDatabase" 'PrefixI 'True) (((S1 ('MetaSel ('Just "title") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector RichText))) :*: S1 ('MetaSel ('Just "icon") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Icon))) :*: (S1 ('MetaSel ('Just "cover") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Cover)) :*: S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector RichText))))) :*: ((S1 ('MetaSel ('Just "isInline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "isLocked") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "inTrash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "parent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Parent)))))) | |||||
data QueryDatabase Source #
Query database request
Constructors
| QueryDatabase | |
Instances
| Generic QueryDatabase Source # | |||||
Defined in Notion.V1.Databases Associated Types
| |||||
| Show QueryDatabase Source # | |||||
Defined in Notion.V1.Databases Methods showsPrec :: Int -> QueryDatabase -> ShowS # show :: QueryDatabase -> String # showList :: [QueryDatabase] -> ShowS # | |||||
| ToJSON QueryDatabase Source # | |||||
Defined in Notion.V1.Databases Methods toJSON :: QueryDatabase -> Value # toEncoding :: QueryDatabase -> Encoding # toJSONList :: [QueryDatabase] -> Value # toEncodingList :: [QueryDatabase] -> Encoding # omitField :: QueryDatabase -> Bool # | |||||
| type Rep QueryDatabase Source # | |||||
Defined in Notion.V1.Databases type Rep QueryDatabase = D1 ('MetaData "QueryDatabase" "Notion.V1.Databases" "notion-client-0.7.0.2-inplace" 'False) (C1 ('MetaCons "QueryDatabase" 'PrefixI 'True) ((S1 ('MetaSel ('Just "filter") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Filter)) :*: S1 ('MetaSel ('Just "sorts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Sort]))) :*: (S1 ('MetaSel ('Just "startCursor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "pageSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "filterProperties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Text])))))) | |||||
Servant
type API = "databases" :> ((ReqBody '[JSON] CreateDatabase :> Post '[JSON] DatabaseObject) :<|> ((Capture "database_id" DatabaseID :> Get '[JSON] DatabaseObject) :<|> ((Capture "database_id" DatabaseID :> (ReqBody '[JSON] UpdateDatabase :> Patch '[JSON] DatabaseObject)) :<|> (Capture "database_id" DatabaseID :> ("query" :> (ReqBody '[JSON] QueryDatabase :> Post '[JSON] (ListOf PageObject))))))) Source #
Servant API