emqx/apps/emqx_connector
Thales Macedo Garitezi 7a16ff4f04 fix(postgres_bridge): fix table existence check and handle sync_required
Fixes https://emqx.atlassian.net/browse/EMQX-10629

During health checking, we check whether tables in the SQL statement
exist.  Such check was done by asking the backend to parse the
statement using a named prepared statements.  Concurrent health checks
could then result in the error:

```erlang
{error,{error,error,<<"42P05">>,duplicate_prepared_statement,<<"prepared statement \"get_status\" already exists">>,[{file,<<"prepare.c">>},{line,<<"451">>},{routine,<<"StorePreparedStatement">>},{severity,<<"ERROR">>}]}}
```

This could lead to an inconsistent state in the driver process, which
would crash later when a message from the backend (`READY_FOR_QUERY`, "idle"):

```
  2023-07-24T13:05:58.892043+00:00 [error] Generic server <0.2134.0> terminating. Reason: {'module could not be loaded',[{undefined,handle_message,[90,<<"I">>,...
```

Added calls to `epgsql:sync/1` for functions that could return
`{error, sync_required}`.

Also, redundant calls to `parse2` were removed to reduce the number of requests.
2023-07-25 09:15:14 -03:00
..
etc feat: generate a minimized emqx.conf 2022-05-31 19:20:27 +08:00
include feat: add clickhouse database bridge 2023-03-02 12:22:11 +01:00
src fix(postgres_bridge): fix table existence check and handle sync_required 2023-07-25 09:15:14 -03:00
test refactor: HTTP connector into emqx_bridge_http app 2023-07-12 14:46:43 +02:00
.gitignore Revert "chore: mv emqx_connector to emqx_data_bridge" 2021-06-17 19:11:10 +08:00
docker-ct refactor: move MySQL open source connector to its own app 2023-06-27 16:15:18 +02:00
README.md refactor: move MySQL open source connector to its own app 2023-06-27 16:15:18 +02:00
rebar.config refactor: move MySQL open source connector to its own app 2023-06-27 16:15:18 +02:00

emqx_connector

This application is a collection of connectors.

A connector is a callback module of emqx_resource that maintains the data related to external resources.