javascript + SQL Write SQL Client tool Tabris

Source: Internet
Author: User
Tags sql client

Wishing you 2018 Happy New Year, a creative script was discovered shortly beforeJtsql (written in Java)The Open source address is:Https://github.com/noear/JtSQLJtsql Features:
*. combination of JS, SQL, template concept;
*. Keep the syntax highlighting for JS and SQL (for DBA Review);
*. Convenient and unified management, deployment, operation
*. Provide current context and variable support as stored procedures;
*. Like SQL Client tools, instant writing is run instantly;
*. provide process and logic control capabilities like custom statistical programs;
*. Server run ( do not misunderstand the client run Ah ...) )It's true that there's always such a problem at work .often to pull SQL, sometimes a sentence of SQL execution can be scored multiple times SQL,write SQL to write the heart tired. The combination of JavaScript and SQL is really great. To solve the problems that have been bothering you.With this as a creative point, I've also got a tool I named Tabris script tool Open Source address is:https://github.com/yuzd/ClearScript.Manager (PS: Everyone has a proposal to mention)Characteristics: 1 contains all features of the Jtsql2using Microsoft's Clearscript V8 engineFor details, please refer to:https://microsoft.github.io/ClearScript/Tutorial/FAQtorial.html?from=timeline&isappinstalled=0Clearscript is so powerful that C # and JavaScript are interoperable3 Modular Functions 3 important modules that are now implemented1. Execute the HTTP request Processing Module 2. Log output Processing Module 3. Executes the SQL Processing module. 4. JS code Smart Hint Tabris module later want to use other functions can expand other modules4. Code writing using Codemirror, write JS code smart tipsNow, let's take a picture of it. Take the following scenario as an example

Encapsulated SQL Log HTTP three-component methods on the editor can code smart tips

//DB Processorvardb = This. Tabris.create (' SQL ', {name:' Testorm ', type:' MySQL '});//HTTP ProcessorvarHTTP = This. Tabris.create (' HTTP ', {method:' GET '});//Log ProcessorvarLog = This. Tabris.create (' LOG ', {trace:true});d B.Delete(' Delete from Child_district ');//get all the city code from the district tablevarGet_district_sql = "Select Code from District";varDistrict_code_list =db.query (get_district_sql); for(varindex = 0; Index < district_code_list.length; index++) {Getchilddistrictandinserttodb (District_code_list[index]. Code);}//Remote AccessfunctionGetchilddistrictandinserttodb (Parentcode) {log.info (Parentcode); varRe =http.getjson ({URL:' Https://fuwu.sf-express.com/service/address/newAddr/getNewSubAddress?parentCode= ' +Parentcode}); if(!re.subaddresslist | |!re.subaddresslist.length)return;  for(varindex = 0; Index < re.subAddressList.length; index++) {    varChild =Re.subaddresslist[index]; varInsertsql = "INSERT into Child_district (name,code,datachange_lasttime) VALUES ('" + Child.distcnname + "', '" + Child.distcode + "', Now ())"; varInsertresult =Db.insert (insertsql)if(insertresult!=1) {log.error (Child.distcnname+ ' Insert db failed! '); }Else{log.info (child.distcnname+ ' Insert DB success! ')    }  }}

Client Download

javascript + SQL Write SQL Client tool Tabris

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.