Has been looking for a better mac Mysql tool
Try a few:
Navicat is really a card
tableplus is a good idea, but what's more painful is the fee.
At first, Sequel Pro didn't work well, but now it feels perfect and needs to be tuned up.
Directly into the theme:
1.Sequel Pro settings prompt delay is 0.5s, which I have been using the default, prompt super slow, very uncomfortable, very smooth after adjustment.
2. Single row by column display, this function tableplus is very useful, I always hope to have a function like this.
3. Formatting of SQL Statements https://www.jianshu.com/p/bbf...
Let's start with the final results.
Perfect enough to display tables and filter by keyword
Origin:
First, I want to develop a SQL formatting tool. Look up the following two articles, inspired by the official JSON export, and consult the official documents.
https://www.jianshu.com/p/bbf...
https://sequelpro.com/docs/bu...
1. Configure the Sequel Pro bundle option Bundles - > Bundle Editor - > Date table, click Show - > and then click the bottom left corner + sign to add a new one, just set it as shown below.
bundle scope : Date Table
Input: select rows(csv)
output: show as HTML
SHOW AS HTML TOOLTIP can also be selected for direct prompting.
1. Using Python to parse the corresponding content csv format, the code is relatively simple, mainly Python is not familiar with
2. Just output HTML according to the table fixed format.
3. Filtering elements in table s through js
#!/usr/bin/python #coding=utf-8 import urllib2, urllib import json import sys reload(sys) sys.setdefaultencoding('utf-8') data = sys.stdin.readlines() #Filter out missing data tables if len(data) > 0 : print '<input type="text" id="filterName" style="width:140px;height:30px"/> <button id="filterBtn">filter</button>' print '<button id="resetBtn">reset</button><br>' else: exit(0) header = data[0].strip('\n'); headers = header.split(",") rowdata = data[1]; rowdatas = rowdata.split(",") content_tab_row = '<table border="1" cellspacing="0"> ' row_tr = "" for index in range(len(headers)): row_tr = row_tr + " <tr><th>" +headers[index].strip('"') +" </th><th>" +rowdatas[index].strip('"') +"</th> " + "</tr>" content_tab_row = content_tab_row + row_tr + "</table>" print content_tab_row #Introducing jQuery print '<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.min.js"></script>' print '<script type="text/javascript">' print 'jQuery.expr[":"].contains=function(a,i,m){return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0};' print '$("#filterBtn").click(function(){var keyword=$("#filterName").val();if(keyword==undefined||keyword==""){return}$("table tbody tr").hide().filter(":contains(\'"+(keyword)+"\')").show()});' print '$("#resetBtn").click(function(){window.location.reload()});' print '</script>'
That would be a great success.
Problems encountered:
At first, I thought it was enough to display, but I still wanted to realize the filtering function, which is very common.
Looking at the document found that SHOW AS HTML is JavaScript-enabled
However, it has been unsuccessful to try, and later found that the actual page export is HTML, which can reasonably execute the js code, and then a simple test found that it can really achieve this function.
So filter was added later.