Sha256: 8bd0ca5d484cbef013de4ef99aff9de8a367c48c39a7765bf73db3ca04fede06

Contents?: true

Size: 1.31 KB

Versions: 12

Compression:

Stored size: 1.31 KB

Contents

- blazer_title "Schema: #{@data_source.name}"
%h1
  Schema: #{@data_source.name}
%hr/
#header
  %input#search.search.form-control{:placeholder => "Start typing a table or column", :style => "width: 300px; display: inline-block;", :type => "text"}/
- @schema.each do |table|
  %table.table.schema-table
    %thead
      %tr
        %th{:colspan => "2"}
          = table[:table]
          - if table[:schema] != "public"
            %span.text-muted{:style => "font-weight: normal;"}= table[:schema]
    %tbody
      - table[:columns].each do |column|
        %tr
          %td{:style => "width: 60%;"}= column[:name]
          %td.text-muted= column[:data_type]
:javascript
  $("#search").on("keyup", function() {
    var value = $(this).val().toLowerCase()
    $(".schema-table").filter(function() {
      // if found in table name, show entire table
      // if just found in rows, show row

      var found = $(this).find("thead").text().toLowerCase().indexOf(value) > -1

      if (found) {
        $(this).find("tbody tr").toggle(true)
      } else {
        $(this).find("tbody tr").filter(function() {
          var found2 = $(this).text().toLowerCase().indexOf(value) > -1
          $(this).toggle(found2)
          if (found2) {
            found = true
          }
        })
      }

      $(this).toggle(found)
    })
  }).focus()

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sql-jarvis-2.1.11 app/views/blazer/queries/schema.html.haml
sql-jarvis-2.1.10 app/views/blazer/queries/schema.html.haml
sql-jarvis-2.1.9 app/views/blazer/queries/schema.html.haml
sql-jarvis-2.1.8 app/views/blazer/queries/schema.html.haml
sql-jarvis-2.1.7 app/views/blazer/queries/schema.html.haml
sql-jarvis-2.1.6 app/views/blazer/queries/schema.html.haml
sql-jarvis-2.1.5 app/views/blazer/queries/schema.html.haml
sql-jarvis-2.1.4 app/views/blazer/queries/schema.html.haml
sql-jarvis-2.1.3 app/views/blazer/queries/schema.html.haml
sql-jarvis-2.1.2 app/views/blazer/queries/schema.html.haml
sql-jarvis-2.1.1 app/views/blazer/queries/schema.html.haml
sql-jarvis-2.1 app/views/blazer/queries/schema.html.haml