- args:
    cascade: true
    read_only: false
    sql: "CREATE OR REPLACE FUNCTION public.search_jobs(search text)\r\n RETURNS SETOF
      jobs\r\n LANGUAGE plpgsql\r\n STABLE\r\nAS $function$ BEGIN if search = '' then
      return query\r\nselect *\r\nfrom jobs j;\r\nelse return query\r\nSELECT *\r\nFROM
      jobs j2\r\nWHERE  ownr_fn ILIKE '%' || search || '%'\r\n    or ownr_ln ILIKE
      '%' || search || '%'\r\n   \r\n    or clm_no ILIKE '%' || search || '%'\r\n\r\nORDER
      BY \r\n     clm_no ILIKE '%' || search || '%'\r\n    OR null,\r\n    ownr_fn
      ILIKE '%' || search || '%'\r\n    OR NULL,\r\n   ownr_ln ILIKE '%' || search
      || '%'\r\n    OR NULL;\r\nend if;\r\nEND $function$;"
  type: run_sql
- args:
    name: search_jobs
    schema: public
  type: track_function
