From f9448ab1889188eb85df9f001f86d971c3e177e8 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Wed, 25 Jan 2023 19:46:16 +0400 Subject: [PATCH] Fix code style --- 20230125142000_functions.up.sql | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/20230125142000_functions.up.sql b/20230125142000_functions.up.sql index aa3238c..416df33 100644 --- a/20230125142000_functions.up.sql +++ b/20230125142000_functions.up.sql @@ -1,16 +1,13 @@ BEGIN; -CREATE FUNCTION is_name(value TEXT) RETURNS BOOLEAN LANGUAGE plpgsql AS $$ -BEGIN +CREATE FUNCTION is_name(value TEXT) RETURNS BOOLEAN LANGUAGE plpgsql +AS $$BEGIN RETURN value = btrim(value) AND length(value) > 0; -END; -$$; +END$$; CREATE FUNCTION is_language_code(value VARCHAR) RETURNS BOOLEAN LANGUAGE plpgsql -AS $$ -BEGIN +AS $$BEGIN RETURN value ~ '^[a-z]{2}$'; -END; -$$; +END$$; COMMIT;