|
@@ -50,10 +50,10 @@ description() ->
|
|
|
|
|
|
|
|
create(#{query := SQL0} = Source) ->
|
|
create(#{query := SQL0} = Source) ->
|
|
|
{SQL, PlaceHolders} = emqx_authz_utils:parse_sql(SQL0, '$n', ?PLACEHOLDERS),
|
|
{SQL, PlaceHolders} = emqx_authz_utils:parse_sql(SQL0, '$n', ?PLACEHOLDERS),
|
|
|
- ResourceID = emqx_authz_utils:make_resource_id(emqx_connector_pgsql),
|
|
|
|
|
|
|
+ ResourceID = emqx_authz_utils:make_resource_id(emqx_postgresql),
|
|
|
{ok, _Data} = emqx_authz_utils:create_resource(
|
|
{ok, _Data} = emqx_authz_utils:create_resource(
|
|
|
ResourceID,
|
|
ResourceID,
|
|
|
- emqx_connector_pgsql,
|
|
|
|
|
|
|
+ emqx_postgresql,
|
|
|
Source#{prepare_statement => #{ResourceID => SQL}}
|
|
Source#{prepare_statement => #{ResourceID => SQL}}
|
|
|
),
|
|
),
|
|
|
Source#{annotations => #{id => ResourceID, placeholders => PlaceHolders}}.
|
|
Source#{annotations => #{id => ResourceID, placeholders => PlaceHolders}}.
|
|
@@ -62,7 +62,7 @@ update(#{query := SQL0, annotations := #{id := ResourceID}} = Source) ->
|
|
|
{SQL, PlaceHolders} = emqx_authz_utils:parse_sql(SQL0, '$n', ?PLACEHOLDERS),
|
|
{SQL, PlaceHolders} = emqx_authz_utils:parse_sql(SQL0, '$n', ?PLACEHOLDERS),
|
|
|
case
|
|
case
|
|
|
emqx_authz_utils:update_resource(
|
|
emqx_authz_utils:update_resource(
|
|
|
- emqx_connector_pgsql,
|
|
|
|
|
|
|
+ emqx_postgresql,
|
|
|
Source#{prepare_statement => #{ResourceID => SQL}}
|
|
Source#{prepare_statement => #{ResourceID => SQL}}
|
|
|
)
|
|
)
|
|
|
of
|
|
of
|