| Invalid Date
字数 0阅读时长 1 分钟

1. Class methods

self.find(id, dry_run: false)

  • [PARAM] id database_id (String)
  • [PARAM(optional)] dry_run: true if you want to create a verification script (Boolean)
  • [EXCEPTION] StandardError throw StandardError when the database is not found.
Database.find(id) creates a Database object with retrieving database API. The created object has database information generated from the JSON response.
Database.find id, dry_run: true creates shell script using Retrieve a database API for verification.

2. Instance methods

created_time → CreatedTimeProperty

created_time returns the CreatedTimeProperty object for querying database.

date_sources → Array<DataSource>

data_sources returns an Array of DataSources.
 

database_title → RichTextArray

database_title returns a RichTextArray object of the database’s title.

description → RichTextArray

description returns a RichTextArray object of the database’s description.

description=(text_info)

  • [PARAM] text_info
    • 📃
      The following objects are used for this argument.
      • a String like as “text” (String)
      • an Array of Strings (Array of Strings)
      • a RichTextObject (RichTextObject)
      • an Array of RichTextObjects (Array of RichTextObjects)
      • a RichTextArray (RichTextArray)
description=(text_info) updates the database description using a text_info.

is_inline → Boolean

is_inline returns the value true if the database appears in the page as an inline block.

is_inline=(flag)

is_inline=(flag) updates the database inline flag a flag value.

icon → Hash

icon returns JSON hash for the page icon.

last_edited_time → LastEditedTimeProperty

last_edited_time returns theLastEditedTimeProperty object for querying database.

new_record? → Boolean, NilClass

new_record? returns true if the page is generated by create_child_database.

save(dry_run: false) →
🧱
Database

  • [PARAM(optional)] dry_run: true if you want to create a verification script
save method updates existing database properties. The database needs to be retrieved using find to prevent existing settings from disappearing.
db.save dry_run: true creates a shell script for verification (Update database API)

set_cover(url: nil, file_upload_object: nil)

  • [PARAM(optional)] a_url
    • external url (String)
  • [PARAM(optional)] a_fuo
    • file upload object (FileUploadObject)
set_cover can change the page cover using external url or file upload object.

set_icon(emoji: nil, url: nil, file_upload_object: nil)

  • [PARAM(optional)] an_emoji
    • emoji string (String)
  • [PARAM(optional)] a_url
    • external url (String)
  • [PARAM(optional)] a_fuo
    • file upload object (FileUploadObject)
set_icon can change the page icon using emoji, external url, or file upload object.
Loading...
目录