chore(*.sql): use sql-formatter for sql formatting
This commit is contained in:
parent
cf1ee4c97f
commit
1d7f13d1f5
63 changed files with 4432 additions and 2358 deletions
|
@ -1,21 +1,24 @@
|
|||
DROP FUNCTION IF EXISTS search_optimized_index(text, integer, integer, text[]);
|
||||
DROP FUNCTION IF EXISTS search_optimized_index (text, integer, integer, text[]);
|
||||
|
||||
CREATE FUNCTION search_optimized_index(search_query text, page_size integer, page_offset integer, sections text[])
|
||||
RETURNS TABLE(
|
||||
result_id integer,
|
||||
url text,
|
||||
title text,
|
||||
description text,
|
||||
tags text[],
|
||||
genre_name text,
|
||||
genre_url text,
|
||||
section text,
|
||||
type text,
|
||||
total_plays text,
|
||||
rank real,
|
||||
total_count bigint
|
||||
)
|
||||
AS $$
|
||||
CREATE FUNCTION search_optimized_index (
|
||||
search_query text,
|
||||
page_size integer,
|
||||
page_offset integer,
|
||||
sections text[]
|
||||
) RETURNS TABLE (
|
||||
result_id integer,
|
||||
url text,
|
||||
title text,
|
||||
description text,
|
||||
tags text[],
|
||||
genre_name text,
|
||||
genre_url text,
|
||||
section text,
|
||||
type text,
|
||||
total_plays text,
|
||||
rank real,
|
||||
total_count bigint
|
||||
) AS $$
|
||||
BEGIN
|
||||
RETURN QUERY
|
||||
SELECT
|
||||
|
@ -42,5 +45,4 @@ BEGIN
|
|||
rank DESC
|
||||
LIMIT page_size OFFSET page_offset;
|
||||
END;
|
||||
$$
|
||||
LANGUAGE plpgsql;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue