(schema: string, table: string)
| 742 | export const dropSearchFunctionQuery = (schema: string, table: string): string => |
| 743 | dropFunction(schema, searchFunctionName(schema, table)); |
| 744 | export const createSearchFunctionQuery = (schema: string, table: string): string => { |
| 745 | const functionName = searchFunctionName(schema, table); |
| 746 | return ` |
| 747 | create or replace function ${escapedName(schema, functionName)}(search text) |
| 748 | returns setof ${escapedName(schema, table)} as $$ |
| 749 | select * |
| 750 | from ${escapedName(schema, table)} as "table" |
| 751 | where "table"."${TS_VECTOR_COL}" @@ to_tsquery(search) |
| 752 | $$ language sql stable; |
| 753 | `; |
| 754 | }; |
| 755 | |
| 756 | export const commentSearchFunctionQuery = (schema: string, table: string): Query => |
| 757 | commentOnFunction(schema, searchFunctionName(schema, table), `@name search_${table}`); |
nothing calls this directly
no test coverage detected