You could use the ~>
syntax, available in Elixir2_000 (Match on the end of a pipe (Matchpipe?))
def is_sql_select?(sql) when not is_nil(sql) do
sql
|> String.trim_leading()
|> String.slice(0, 6)
|> String.upcase()
|> x ~> x == "SELECT"
end