execute2 method
Implementation
@override
Future<String> execute2(
{required String functionId, Map<String, dynamic>? params, bool isAsync = true}) async {
//print('execute2 $functionId');
await initialize();
Map<String, dynamic> realParams = {};
//realParams["projectId"] = myConfig!.serverConfig.dbConnInfo.projectId;
//realParams["databaseId"] = myConfig!.serverConfig.dbConnInfo.appId;
realParams["endPoint"] = myConfig!.serverConfig.dbConnInfo.databaseURL;
realParams["apiKey"] = myConfig!.serverConfig.dbConnInfo.apiKey;
realParams["roleKey"] = myConfig!.serverConfig.dbConnInfo.appId;
if (params != null) {
realParams.addAll(params);
}
String body = jsonEncode(realParams);
final FunctionResponse response = await Supabase.instance.client.functions
.invoke(functionId, body: body, queryParameters: realParams);
if (response.status != 200) {
// 오류가 발생한 경우
logger.info('Error invoking function: ${response.status}');
} else {
// 성공적으로 반환 값을 받은 경우
logger.info('Function response: ${response.status}, ${response.data}');
}
return response.data.toString();
}