Packages

An elixir package that adds ability to query your database through a web UI.

Current section

Files

Jump to
binoculars lib binoculars_web live page_live.html.leex
Raw

lib/binoculars_web/live/page_live.html.leex

<form phx-submit="execute" accept-charset="utf-8">
<textarea phx-key="Enter" phx-keyup="execute" name="query" cols="30" rows="10"><%= @query %></textarea>
<input type="submit" value="Execute">
</form>
<%= if @error do %>
<p class="alert alert-danger">
<%= @error %>
</p>
<% end %>
<%= @number_of_rows %> rows found
<table>
<tr>
<%= for col <- @columns do %>
<th>
<%= col %>
</th>
<% end %>
</tr>
<%= for row <- @rows do %>
<tr>
<%= for c <- row do %>
<td>
<%= c %>
</td>
<% end %>
</tr>
<% end %>
</table>