Overview
CloudBase provides a PostgreSQL database service, built on the open-source PostgREST, supporting complete SQL features and offering developers a stable and reliable data storage solution.
Use AI to manage relational databases and SQL operations
How to Enable
When you activate a CloudBase PostgreSQL environment, the PostgreSQL database is automatically enabled without the need to manually create or initialize a database instance.
SDK Integration
CloudBase provides multiple SDKs for developers to operate PostgreSQL databases:
| SDK Type | Applicable Platform |
|---|---|
| Mini Program ClientSDK | Mini Program |
| JS SDK | Web Browser |
| Node SDK | Node.js Environment |
| HTTP API | Universal |
After obtaining the db instance with Mini Program ClientSDK, the syntax for operating the PostgreSQL database is consistent with the Web JS SDK. For specific syntax, please refer to the JS SDK.
Common Error Handling
xxx.rdb is not a function
Error Cause: The CloudBase SDK version currently in use is too old and does not support PostgreSQL database operations.
Solution: Update the current 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 PostgreSQL database functionality.
Solution: Update the WeChat base library to version 3.8.9 or above.
Set the minimum base library version in WeChat DevTools:
- Open "Project Details"
- In "Local Settings", set "Debug Base Library" to version 3.8.9 or higher
- In "Basic Information", set "Minimum Base Library Version" to version 3.8.9 or higher
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.