Skip to main content

CRUD Operations

CloudBase provides multiple SDKs for developers to operate MySQL databases, including Mini Program SDK, JS SDK, Node SDK, etc.

SDK TypeApplicable Platform
Mini Program ClientSDKMini Program
JS SDKWeb Browser
Node SDKNode.js Environment
HTTP APIUniversal
⚠️ Note

After obtaining the db instance with Mini Program ClientSDK, the syntax for operating MySQL database is consistent with WebSDK. For specific syntax, please refer to JS SDK

Common Error Handling

xxx.rdb is not a function

Error Cause: The SDK version is too old and does not support MySQL database operations.

Solution: Update SDK to the latest version.

Generating default gateway base url failed: env not found

Error Cause: The WeChat base library version is too low and does not support CloudBase MySQL database functionality.

Solution: Update the WeChat base library to version 3.8.9 or above.

Set the minimum base library version in WeChat DevTools:

  1. Open "Project Details"
  2. In "Local Settings", set "Debug Base Library" to version 3.8.9 or higher
  3. In "Basic Information", set "Minimum Base Library Version" to version 3.8.9 or higher
Note

After updating the base library version, please ensure compatibility handling for the Mini Program in lower versions of WeChat, or set the minimum version requirement in the Mini Program admin console.