Skip to main content

安裝

  1. Add InsForge dependencies to your project
build.gradle.kts:
  1. Initialize InsForge SDK
  1. Enable Logging (Optional)
For debugging, you can configure the SDK log level:
Use NONE or ERROR in production to avoid exposing sensitive data in logs.

Android Initialization

  1. Add Chrome Custom Tabs dependency to your build.gradle.kts:
  1. Initialize InsForge SDK (With Chrome Custom Tabs and Session Storage)
  1. Use Jetpack DataStore for Session Storage (Optional)

insert()

將新記錄插入表格中。

範例


update()

更新表格中的現有記錄。

範例


delete()

從表格中刪除記錄。

範例


select()

從表格中查詢記錄。

範例


executeRaw()

執行 SELECT 查詢並傳回原始 JSON 陣列。當您需要處理動態/無型別資料(例如傳回巢狀物件的聯結查詢)時,請使用此方法。

範例


rpc()

呼叫 PostgreSQL 預存函式(RPC - 遠端程序呼叫)。此方法可讓您直接呼叫資料庫中定義的 SQL 函式。

簽章

參數

  • functionName (String) - 要呼叫的 PostgreSQL 函式名稱
  • args (Map\<String, Any?\>?, optional) - 要傳遞給函式的引數

實作詳細資料

  • 無引數:使用 GET 請求到 /api/database/rpc/{functionName}
  • 有引數:使用 POST 請求(JSON 正文)到 /api/database/rpc/{functionName}

範例

rpcRaw() 範例

當傳回型別在編譯時動態或未知時,使用 rpcRaw()

篩選條件


修飾詞