19 lines
300 B
MySQL
19 lines
300 B
MySQL
|
CREATE FUNCTION _api.raise_unique(
|
||
|
_column TEXT DEFAULT ''
|
||
|
)
|
||
|
RETURNS BOOLEAN
|
||
|
LANGUAGE plpgsql VOLATILE
|
||
|
AS $BODY$
|
||
|
BEGIN
|
||
|
PERFORM _api.raise(
|
||
|
_msg => 'api_unique_value',
|
||
|
_detail => _column
|
||
|
);
|
||
|
|
||
|
RETURN TRUE;
|
||
|
END
|
||
|
$BODY$;
|
||
|
|
||
|
GRANT EXECUTE ON FUNCTION _api.raise_unique(TEXT)
|
||
|
TO rest_anon, rest_user;
|