dbgate-plugin-mssql 5.0.0-alpha.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/backend.js CHANGED
@@ -426,7 +426,7 @@ var _t,wt,Et={assert:v,DateTimeBuilder:Z,DateTimeParseContext:X,DateTimePrintCon
426
426
  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
427
427
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
428
428
  * POSSIBILITY OF SUCH DAMAGE.
429
- */var r,i=n(6).parse,o=n(0),a=n(504)({exact:!0}),s=n(232),u=n(234).Store,c=n(506).MemoryCookieStore,l=n(236).pathMatch,p=n(507);try{r=n(66)}catch(e){console.warn("tough-cookie: can't load punycode; won't use punycode for domain normalization")}var f=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/,h=/[\x00-\x1F]/,d=["\n","\r","\0"],m=/[\x20-\x3A\x3C-\x7E]+/,g=/[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/,v={jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11},y=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],b=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function _(e,t,n,r){for(var i=0;i<e.length;){var o=e.charCodeAt(i);if(o<=47||o>=58)break;i++}return i<t||i>n?null:r||i==e.length?parseInt(e.substr(0,i),10):null}function w(e){var t=e.split(":"),n=[0,0,0];if(3!==t.length)return null;for(var r=0;r<3;r++){var i=2==r,o=_(t[r],1,2,i);if(null===o)return null;n[r]=o}return n}function E(e){e=String(e).substr(0,3).toLowerCase();var t=v[e];return t>=0?t:null}function S(e){if(e){var t=e.split(g);if(t){for(var n=null,r=null,i=null,o=null,a=null,s=null,u=0;u<t.length;u++){var c,l=t[u].trim();if(l.length)null===i&&(c=w(l))?(n=c[0],r=c[1],i=c[2]):null!==o||null===(c=_(l,1,2,!0))?null!==a||null===(c=E(l))?null===s&&null!==(c=_(l,2,4,!0))&&((s=c)>=70&&s<=99?s+=1900:s>=0&&s<=69&&(s+=2e3)):a=c:o=c}if(!(null===o||null===a||null===s||null===i||o<1||o>31||s<1601||n>23||r>59||i>59))return new Date(Date.UTC(s,a,o,n,r,i))}}}function k(e){var t=e.getUTCDate();t=t>=10?t:"0"+t;var n=e.getUTCHours();n=n>=10?n:"0"+n;var r=e.getUTCMinutes();r=r>=10?r:"0"+r;var i=e.getUTCSeconds();return i=i>=10?i:"0"+i,b[e.getUTCDay()]+", "+t+" "+y[e.getUTCMonth()]+" "+e.getUTCFullYear()+" "+n+":"+r+":"+i+" GMT"}function x(e){return null==e?null:(e=e.trim().replace(/^\./,""),r&&/[^\u0001-\u007f]/.test(e)&&(e=r.toASCII(e)),e.toLowerCase())}function T(e,t,n){if(null==e||null==t)return null;if(!1!==n&&(e=x(e),t=x(t)),e==t)return!0;if(a.test(e))return!1;var r=e.indexOf(t);return!(r<=0)&&(e.length===t.length+r&&"."===e.substr(r-1,1))}function O(e){if(!e||"/"!==e.substr(0,1))return"/";if("/"===e)return e;var t=e.lastIndexOf("/");return 0===t?"/":e.slice(0,t)}function A(e,t){var n,r,i=(e=function(e){for(var t=0;t<d.length;t++){var n=e.indexOf(d[t]);-1!==n&&(e=e.substr(0,n))}return e}(e)).indexOf("=");if(t)0===i&&(i=(e=e.substr(1)).indexOf("="));else if(i<=0)return;if(i<=0?(n="",r=e.trim()):(n=e.substr(0,i).trim(),r=e.substr(i+1).trim()),!h.test(n)&&!h.test(r)){var o=new R;return o.key=n,o.value=r,o}}function N(e,t){t&&"object"==typeof t||(t={});var n=(e=e.trim()).indexOf(";"),r=A(-1===n?e:e.substr(0,n),!!t.loose);if(r){if(-1===n)return r;var i=e.slice(n+1).trim();if(0===i.length)return r;for(var o=i.split(";");o.length;){var a=o.shift().trim();if(0!==a.length){var s,u,c=a.indexOf("=");switch(-1===c?(s=a,u=null):(s=a.substr(0,c),u=a.substr(c+1)),s=s.trim().toLowerCase(),u&&(u=u.trim()),s){case"expires":if(u){var l=S(u);l&&(r.expires=l)}break;case"max-age":if(u&&/^-?[0-9]+$/.test(u)){var p=parseInt(u,10);r.setMaxAge(p)}break;case"domain":if(u){var f=u.trim().replace(/^\./,"");f&&(r.domain=f.toLowerCase())}break;case"path":r.path=u&&"/"===u[0]?u:null;break;case"secure":r.secure=!0;break;case"httponly":r.httpOnly=!0;break;default:r.extensions=r.extensions||[],r.extensions.push(a)}}}return r}}function I(e){var t;try{t=JSON.parse(e)}catch(e){return e}return t}function j(e){if(!e)return null;var t;if("string"==typeof e){if((t=I(e))instanceof Error)return null}else t=e;for(var n=new R,r=0;r<R.serializableProperties.length;r++){var i=R.serializableProperties[r];void 0!==t[i]&&t[i]!==R.prototype[i]&&("expires"===i||"creation"===i||"lastAccessed"===i?null===t[i]?n[i]=null:n[i]="Infinity"==t[i]?"Infinity":new Date(t[i]):n[i]=t[i])}return n}function C(e,t){var n=0,r=e.path?e.path.length:0;return 0!==(n=(t.path?t.path.length:0)-r)?n:0!==(n=(e.creation?e.creation.getTime():2147483647e3)-(t.creation?t.creation.getTime():2147483647e3))?n:n=e.creationIndex-t.creationIndex}function D(e){if(e instanceof Object)return e;try{e=decodeURI(e)}catch(e){}return i(e)}function R(e){e=e||{},Object.keys(e).forEach((function(t){R.prototype.hasOwnProperty(t)&&R.prototype[t]!==e[t]&&"_"!==t.substr(0,1)&&(this[t]=e[t])}),this),this.creation=this.creation||new Date,Object.defineProperty(this,"creationIndex",{configurable:!1,enumerable:!1,writable:!0,value:++R.cookiesCreated})}function P(e,t){"boolean"==typeof t?t={rejectPublicSuffixes:t}:null==t&&(t={}),null!=t.rejectPublicSuffixes&&(this.rejectPublicSuffixes=t.rejectPublicSuffixes),null!=t.looseMode&&(this.enableLooseMode=t.looseMode),e||(e=new c),this.store=e}R.cookiesCreated=0,R.parse=N,R.fromJSON=j,R.prototype.key="",R.prototype.value="",R.prototype.expires="Infinity",R.prototype.maxAge=null,R.prototype.domain=null,R.prototype.path=null,R.prototype.secure=!1,R.prototype.httpOnly=!1,R.prototype.extensions=null,R.prototype.hostOnly=null,R.prototype.pathIsDefault=null,R.prototype.creation=null,R.prototype.lastAccessed=null,Object.defineProperty(R.prototype,"creationIndex",{configurable:!0,enumerable:!1,writable:!0,value:0}),R.serializableProperties=Object.keys(R.prototype).filter((function(e){return!(R.prototype[e]instanceof Function||"creationIndex"===e||"_"===e.substr(0,1))})),R.prototype.inspect=function(){var e=Date.now();return'Cookie="'+this.toString()+"; hostOnly="+(null!=this.hostOnly?this.hostOnly:"?")+"; aAge="+(this.lastAccessed?e-this.lastAccessed.getTime()+"ms":"?")+"; cAge="+(this.creation?e-this.creation.getTime()+"ms":"?")+'"'},o.inspect.custom&&(R.prototype[o.inspect.custom]=R.prototype.inspect),R.prototype.toJSON=function(){for(var e={},t=R.serializableProperties,n=0;n<t.length;n++){var r=t[n];this[r]!==R.prototype[r]&&("expires"===r||"creation"===r||"lastAccessed"===r?null===this[r]?e[r]=null:e[r]="Infinity"==this[r]?"Infinity":this[r].toISOString():"maxAge"===r?null!==this[r]&&(e[r]=this[r]==1/0||this[r]==-1/0?this[r].toString():this[r]):this[r]!==R.prototype[r]&&(e[r]=this[r]))}return e},R.prototype.clone=function(){return j(this.toJSON())},R.prototype.validate=function(){if(!f.test(this.value))return!1;if(!(this.expires==1/0||this.expires instanceof Date||S(this.expires)))return!1;if(null!=this.maxAge&&this.maxAge<=0)return!1;if(null!=this.path&&!m.test(this.path))return!1;var e=this.cdomain();if(e){if(e.match(/\.$/))return!1;if(null==s.getPublicSuffix(e))return!1}return!0},R.prototype.setExpires=function(e){e instanceof Date?this.expires=e:this.expires=S(e)||"Infinity"},R.prototype.setMaxAge=function(e){this.maxAge=e===1/0||e===-1/0?e.toString():e},R.prototype.cookieString=function(){var e=this.value;return null==e&&(e=""),""===this.key?e:this.key+"="+e},R.prototype.toString=function(){var e=this.cookieString();return this.expires!=1/0&&(this.expires instanceof Date?e+="; Expires="+k(this.expires):e+="; Expires="+this.expires),null!=this.maxAge&&this.maxAge!=1/0&&(e+="; Max-Age="+this.maxAge),this.domain&&!this.hostOnly&&(e+="; Domain="+this.domain),this.path&&(e+="; Path="+this.path),this.secure&&(e+="; Secure"),this.httpOnly&&(e+="; HttpOnly"),this.extensions&&this.extensions.forEach((function(t){e+="; "+t})),e},R.prototype.TTL=function(e){if(null!=this.maxAge)return this.maxAge<=0?0:1e3*this.maxAge;var t=this.expires;return t!=1/0?(t instanceof Date||(t=S(t)||1/0),t==1/0?1/0:t.getTime()-(e||Date.now())):1/0},R.prototype.expiryTime=function(e){if(null!=this.maxAge){var t=e||this.creation||new Date,n=this.maxAge<=0?-1/0:1e3*this.maxAge;return t.getTime()+n}return this.expires==1/0?1/0:this.expires.getTime()},R.prototype.expiryDate=function(e){var t=this.expiryTime(e);return t==1/0?new Date(2147483647e3):t==-1/0?new Date(0):new Date(t)},R.prototype.isPersistent=function(){return null!=this.maxAge||this.expires!=1/0},R.prototype.cdomain=R.prototype.canonicalizedDomain=function(){return null==this.domain?null:x(this.domain)},P.prototype.store=null,P.prototype.rejectPublicSuffixes=!0,P.prototype.enableLooseMode=!1;var F=[];function L(e){return function(){if(!this.store.synchronous)throw new Error("CookieJar store is not synchronous; use async API instead.");var t,n,r=Array.prototype.slice.call(arguments);if(r.push((function(e,r){t=e,n=r})),this[e].apply(this,r),t)throw t;return n}}F.push("setCookie"),P.prototype.setCookie=function(e,t,n,r){var i,o=D(t);n instanceof Function&&(r=n,n={});var a=x(o.hostname),u=this.enableLooseMode;if(null!=n.loose&&(u=n.loose),"string"==typeof e||e instanceof String){if(!(e=R.parse(e,{loose:u})))return i=new Error("Cookie failed to parse"),r(n.ignoreError?null:i)}else if(!(e instanceof R))return i=new Error("First argument to setCookie must be a Cookie object or string"),r(n.ignoreError?null:i);var c=n.now||new Date;if(this.rejectPublicSuffixes&&e.domain&&null==s.getPublicSuffix(e.cdomain()))return i=new Error("Cookie has domain set to a public suffix"),r(n.ignoreError?null:i);if(e.domain){if(!T(a,e.cdomain(),!1))return i=new Error("Cookie not in this host's domain. Cookie:"+e.cdomain()+" Request:"+a),r(n.ignoreError?null:i);null==e.hostOnly&&(e.hostOnly=!1)}else e.hostOnly=!0,e.domain=a;if(e.path&&"/"===e.path[0]||(e.path=O(o.pathname),e.pathIsDefault=!0),!1===n.http&&e.httpOnly)return i=new Error("Cookie is HttpOnly and this isn't an HTTP API"),r(n.ignoreError?null:i);var l=this.store;l.updateCookie||(l.updateCookie=function(e,t,n){this.putCookie(t,n)}),l.findCookie(e.domain,e.path,e.key,(function(t,i){if(t)return r(t);var o=function(t){if(t)return r(t);r(null,e)};if(i){if(!1===n.http&&i.httpOnly)return t=new Error("old Cookie is HttpOnly and this isn't an HTTP API"),r(n.ignoreError?null:t);e.creation=i.creation,e.creationIndex=i.creationIndex,e.lastAccessed=c,l.updateCookie(i,e,o)}else e.creation=e.lastAccessed=c,l.putCookie(e,o)}))},F.push("getCookies"),P.prototype.getCookies=function(e,t,n){var r=D(e);t instanceof Function&&(n=t,t={});var i=x(r.hostname),o=r.pathname||"/",a=t.secure;null!=a||!r.protocol||"https:"!=r.protocol&&"wss:"!=r.protocol||(a=!0);var s=t.http;null==s&&(s=!0);var u=t.now||Date.now(),c=!1!==t.expire,p=!!t.allPaths,f=this.store;function h(e){if(e.hostOnly){if(e.domain!=i)return!1}else if(!T(i,e.domain,!1))return!1;return!(!p&&!l(o,e.path))&&(!(e.secure&&!a)&&(!(e.httpOnly&&!s)&&(!(c&&e.expiryTime()<=u)||(f.removeCookie(e.domain,e.path,e.key,(function(){})),!1))))}f.findCookies(i,p?null:o,(function(e,r){if(e)return n(e);r=r.filter(h),!1!==t.sort&&(r=r.sort(C));var i=new Date;r.forEach((function(e){e.lastAccessed=i})),n(null,r)}))},F.push("getCookieString"),P.prototype.getCookieString=function(){var e=Array.prototype.slice.call(arguments,0),t=e.pop(),n=function(e,n){e?t(e):t(null,n.sort(C).map((function(e){return e.cookieString()})).join("; "))};e.push(n),this.getCookies.apply(this,e)},F.push("getSetCookieStrings"),P.prototype.getSetCookieStrings=function(){var e=Array.prototype.slice.call(arguments,0),t=e.pop(),n=function(e,n){e?t(e):t(null,n.map((function(e){return e.toString()})))};e.push(n),this.getCookies.apply(this,e)},F.push("serialize"),P.prototype.serialize=function(e){var t=this.store.constructor.name;"Object"===t&&(t=null);var n={version:"tough-cookie@"+p,storeType:t,rejectPublicSuffixes:!!this.rejectPublicSuffixes,cookies:[]};if(!this.store.getAllCookies||"function"!=typeof this.store.getAllCookies)return e(new Error("store does not support getAllCookies and cannot be serialized"));this.store.getAllCookies((function(t,r){return t?e(t):(n.cookies=r.map((function(e){return delete(e=e instanceof R?e.toJSON():e).creationIndex,e})),e(null,n))}))},P.prototype.toJSON=function(){return this.serializeSync()},F.push("_importCookies"),P.prototype._importCookies=function(e,t){var n=this,r=e.cookies;if(!r||!Array.isArray(r))return t(new Error("serialized jar has no cookies array"));r=r.slice(),function e(i){if(i)return t(i);if(!r.length)return t(i,n);var o;try{o=j(r.shift())}catch(e){return t(e)}if(null===o)return e(null);n.store.putCookie(o,e)}()},P.deserialize=function(e,t,n){var r;if(3!==arguments.length&&(n=t,t=null),"string"==typeof e){if((r=I(e))instanceof Error)return n(r)}else r=e;var i=new P(t,r.rejectPublicSuffixes);i._importCookies(r,(function(e){if(e)return n(e);n(null,i)}))},P.deserializeSync=function(e,t){var n="string"==typeof e?JSON.parse(e):e,r=new P(t,n.rejectPublicSuffixes);if(!r.store.synchronous)throw new Error("CookieJar store is not synchronous; use async API instead.");return r._importCookiesSync(n),r},P.fromJSON=P.deserializeSync,P.prototype.clone=function(e,t){1===arguments.length&&(t=e,e=null),this.serialize((function(n,r){if(n)return t(n);P.deserialize(r,e,t)}))},F.push("removeAllCookies"),P.prototype.removeAllCookies=function(e){var t=this.store;if(t.removeAllCookies instanceof Function&&t.removeAllCookies!==u.prototype.removeAllCookies)return t.removeAllCookies(e);t.getAllCookies((function(n,r){if(n)return e(n);if(0===r.length)return e(null);var i=0,o=[];function a(t){if(t&&o.push(t),++i===r.length)return e(o.length?o[0]:null)}r.forEach((function(e){t.removeCookie(e.domain,e.path,e.key,a)}))}))},P.prototype._cloneSync=L("clone"),P.prototype.cloneSync=function(e){if(!e.synchronous)throw new Error("CookieJar clone destination store is not synchronous; use async API instead.");return this._cloneSync(e)},F.forEach((function(e){P.prototype[e+"Sync"]=L(e)})),t.version=p,t.CookieJar=P,t.Cookie=R,t.Store=u,t.MemoryCookieStore=c,t.parseDate=S,t.formatDate=k,t.parse=N,t.fromJSON=j,t.domainMatch=T,t.defaultPath=O,t.pathMatch=l,t.getPublicSuffix=s.getPublicSuffix,t.cookieCompare=C,t.permuteDomain=n(235).permuteDomain,t.permutePath=function(e){if("/"===e)return["/"];e.lastIndexOf("/")===e.length-1&&(e=e.substr(0,e.length-1));for(var t=[e];e.length>1;){var n=e.lastIndexOf("/");if(0===n)break;e=e.substr(0,n),t.push(e)}return t.push("/"),t},t.canonicalDomain=x},function(e,t,n){var r=n(138),i=n(0),o=n(96),a=n(19),s=n(25),u=n(6).parse,c=n(67),l=n(139),p=n(237),f=n(515);function h(e){if(!(this instanceof h))return new h;for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],r.call(this),e=e||{})this[t]=e[t]}e.exports=h,i.inherits(h,r),h.LINE_BREAK="\r\n",h.DEFAULT_CONTENT_TYPE="application/octet-stream",h.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var o=r.prototype.append.bind(this);if("number"==typeof t&&(t=""+t),i.isArray(t))this._error(new Error("Arrays are not supported."));else{var a=this._multiPartHeader(e,t,n),s=this._multiPartFooter();o(a),o(t),o(s),this._trackLength(a,t,n)}},h.prototype._trackLength=function(e,t,n){var r=0;null!=n.knownLength?r+=+n.knownLength:Buffer.isBuffer(t)?r=t.length:"string"==typeof t&&(r=Buffer.byteLength(t)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(e)+h.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion"))&&(n.knownLength||this._valuesToMeasure.push(t))},h.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):c.stat(e.path,(function(n,r){var i;n?t(n):(i=r.size-(e.start?e.start:0),t(null,i))})):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(n){e.pause(),t(null,+n.headers["content-length"])})),e.resume()):t("Unknown stream")},h.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var r,i=this._getContentDisposition(t,n),o=this._getContentType(t,n),a="",s={"Content-Disposition":["form-data",'name="'+e+'"'].concat(i||[]),"Content-Type":[].concat(o||[])};for(var u in"object"==typeof n.header&&f(s,n.header),s)s.hasOwnProperty(u)&&null!=(r=s[u])&&(Array.isArray(r)||(r=[r]),r.length&&(a+=u+": "+r.join("; ")+h.LINE_BREAK));return"--"+this.getBoundary()+h.LINE_BREAK+a+h.LINE_BREAK},h.prototype._getContentDisposition=function(e,t){var n,r;return"string"==typeof t.filepath?n=o.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?n=o.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(n=o.basename(e.client._httpMessage.path||"")),n&&(r='filename="'+n+'"'),r},h.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e.name&&(n=l.lookup(e.name)),!n&&e.path&&(n=l.lookup(e.path)),!n&&e.readable&&e.hasOwnProperty("httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=l.lookup(t.filepath||t.filename)),n||"object"!=typeof e||(n=h.DEFAULT_CONTENT_TYPE),n},h.prototype._multiPartFooter=function(){return function(e){var t=h.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},h.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+h.LINE_BREAK},h.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(n[t.toLowerCase()]=e[t]);return n},h.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},h.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,r=this._streams.length;n<r;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(h.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},h.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},h.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},h.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},h.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?p.parallel(this._valuesToMeasure,this._lengthRetriever,(function(n,r){n?e(n):(r.forEach((function(e){t+=e})),e(null,t))})):process.nextTick(e.bind(this,null,t))},h.prototype.submit=function(e,t){var n,r,i={method:"post"};return"string"==typeof e?(e=u(e),r=f({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(r=f(e,i)).port||(r.port="https:"==r.protocol?443:80),r.headers=this.getHeaders(e.headers),n="https:"==r.protocol?s.request(r):a.request(r),this.getLength(function(e,r){e?this._error(e):(n.setHeader("Content-Length",r),this.pipe(n),t&&(n.on("error",t),n.on("response",t.bind(this,null))))}.bind(this)),n},h.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},h.prototype.toString=function(){return"[object FormData]"}},,function(e,t,n){const r=n(303);e.exports={packageName:"dbgate-plugin-mssql",drivers:[r],initialize(e){r.initialize(e)}}},function(e,t,n){n(16);const r=n(2),i=n(304),o=n(306),a=n(493),s=n(736),u=n(737),c=n(739),l=new u,{tediousConnect:p,tediousQueryCore:f,tediousReadQuery:h,tediousStream:d}=n(740),{nativeConnect:m,nativeQueryCore:g,nativeReadQuery:v,nativeStream:y}=c;let b;const _=[{title:"Windows",name:"sspi",disabledFields:["password","port","user"]},{title:"SQL Server",name:"sql",disabledFields:["port"]},{title:"NodeJs portable driver (tedious)",name:"tedious"}],w={...i,analyserClass:o,getAuthTypes:()=>b?_:null,async connect(e){const{authType:t}=e;return!b||"sspi"!=t&&"sql"!=t?p(e):m(e)},close:async e=>e.close(),queryCore:async(e,t,n)=>"msnodesqlv8"==e._connectionType?g(e,t,n):f(e,t,n),async query(e,t,n){return l.acquire("connection",async()=>this.queryCore(e,t,n))},stream:async(e,t,n)=>"msnodesqlv8"==e._connectionType?y(e,t,n):d(e,t,n),readQuery:async(e,t,n)=>"msnodesqlv8"==e._connectionType?v(e,t,n):h(e,t,n),async writeTable(e,t,n){return"msnodesqlv8"==e._connectionType?s(this,r,e,t,n):a(this,r,e,t,n)},async getVersion(e){const t=(await this.query(e,"\nSELECT \n @@VERSION AS version, \n SERVERPROPERTY ('productversion') as productVersion,\n CASE \n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '8%' THEN 'SQL Server 2000'\n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '9%' THEN 'SQL Server 2005'\n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '10.0%' THEN 'SQL Server 2008'\n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '10.5%' THEN 'SQL Server 2008 R2'\n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '11%' THEN 'SQL Server 2012'\n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '12%' THEN 'SQL Server 2014'\n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '13%' THEN 'SQL Server 2016' \n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '14%' THEN 'SQL Server 2017' \n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '15%' THEN 'SQL Server 2019' \n ELSE 'Unknown'\n END AS versionText\n")).rows[0];if(t.productVersion){const e=t.productVersion.split("."),n=parseInt(e[0])||0;t.productVersionNumber=n}else t.productVersionNumber=0;return t},async listDatabases(e){const{rows:t}=await this.query(e,"SELECT name FROM sys.databases order by name");return t}};w.initialize=e=>{e.nativeModules&&e.nativeModules.msnodesqlv8&&(b=e.nativeModules.msnodesqlv8()),c.initialize(e)},e.exports=w},function(e,t,n){const{driverBase:r}=global.DBGATE_TOOLS,i=n(305),{mssqlSplitterOptions:o}=n(107),a={limitSelect:!0,rangeSelect:!0,offsetFetchRangeSyntax:!0,rowNumberOverPaging:!0,stringEscapeChar:"'",fallbackDataType:"nvarchar(max)",explicitDropConstraint:!1,enableConstraintsPerTable:!0,dropColumnDependencies:["default","dependencies","indexes","primaryKey","foreignKeys","uniques"],changeColumnDependencies:["indexes","dependencies","uniques"],anonymousPrimaryKey:!1,dropIndexContainsTableSpec:!0,quoteIdentifier:e=>`[${e}]`,createColumn:!0,dropColumn:!0,changeColumn:!0,createIndex:!0,dropIndex:!0,createForeignKey:!0,dropForeignKey:!0,createPrimaryKey:!0,dropPrimaryKey:!0,createUnique:!0,dropUnique:!0,createCheck:!0,dropCheck:!0,dropReferencesWhenDropTable:!0,columnProperties:{isSparse:!0,isPersisted:!0}},s={...r,dumperClass:i,dialect:a,readOnlySessions:!1,dialectByVersion:e=>e&&e.productVersionNumber<11?{...a,rangeSelect:!1,offsetFetchRangeSyntax:!1}:a,showConnectionField:(e,t)=>["authType","server","port","user","password","defaultDatabase","singleDatabase","isReadOnly"].includes(e),getQuerySplitterOptions:()=>o,engine:"mssql@dbgate-plugin-mssql",title:"Microsoft SQL Server",defaultPort:1433,defaultAuthTypeName:"tedious",getNewObjectTemplates:()=>[{label:"New view",sql:"CREATE VIEW myview\nAS\nSELECT * FROM table1"},{label:"New procedure",sql:"CREATE PROCEDURE myproc (@arg1 INT)\nAS\nBEGIN\n SELECT * FROM table1\nEND"},{label:"New function",sql:"CREATE FUNCTION myfunc (@arg1 INT) RETURNS INT\nAS\nBEGIN\n RETURN 1;\nEND"},{label:"New table valued function",sql:"CREATE FUNCTION myfunc (@arg1 INT) RETURNS TABLE \nAS\nRETURN SELECT * FROM table1"}]};e.exports=s},function(e,t){const{SqlDumper:n,testEqualColumns:r,arrayToHexString:i}=global.DBGATE_TOOLS;class o extends n{constructor(e,t){super(e),t&&t.useHardSeparator&&(this.useHardSeparator=!0)}endCommand(){this.useHardSeparator?this.putRaw("\nGO\n"):super.endCommand()}autoIncrement(){this.put(" ^identity")}putStringValue(e){/[^\u0000-\u00ff]/.test(e)&&this.putRaw("N"),super.putStringValue(e)}putByteArrayValue(e){super.putRaw("0x"+i(e))}allowIdentityInsert(e,t){this.putCmd("^set ^identity_insert %f %k",e,t?"on":"off")}transform(e,t){switch(e){case"GROUP:YEAR":case"YEAR":this.put("^datepart(^year, %c)",t);break;case"MONTH":this.put("^datepart(^month, %c)",t);break;case"DAY":this.put("^datepart(^day, %c)",t);break;case"GROUP:MONTH":this.put("^convert(^varchar(100), ^datepart(^year, %c)) + '-' + right('0' + ^convert(^varchar(100), ^datepart(^month, %c)), 2)",t,t);break;case"GROUP:DAY":this.put("^^convert(^varchar(100), ^datepart(^year, %c)) + '-' + ^right('0' + ^convert(^varchar(100), ^datepart(^month, %c)), 2)+'-' + ^right('0' + ^convert(^varchar(100), ^datepart(^day, %c)), 2)",t,t,t);break;default:t()}}renameObject(e,t){this.putCmd("^execute sp_rename '%f', '%s', 'OBJECT'",e,t)}changeObjectSchema(e,t){this.putCmd("^execute sp_changeobjectowner '%f', '%s'",e,t)}dropTable(e,t={}){t.testIfExists&&this.put("IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'%f') AND type in (N'U'))&n",e),super.dropTable(e,t)}dropColumn(e){e.defaultConstraint&&this.putCmd("^alter ^table %f ^drop ^constraint %i",e,e.defaultConstraint),super.dropColumn(e)}dropDefault(e){e.defaultConstraint&&this.putCmd("^alter ^table %f ^drop ^constraint %i",e,e.defaultConstraint)}guessDefaultName(e){return e.defaultConstraint||`DF${e.schemaName||"dbo"}_${e.pureName}_col.columnName`}createDefault(e){if(!e.defaultValue)return;const t=e.defaultValue;if(!t){const n=this.guessDefaultName(e);this.putCmd("^alter ^table %f ^add ^constraint %i ^default %s for %i",e,n,t,e.columnName)}}renameColumn(e,t){this.putCmd("^execute sp_rename '%f.%i', '%s', 'COLUMN'",e,e.columnName,t)}changeColumn(e,t,n){r(e,t,!1,!1)?(this.dropDefault(e),e.columnName!=t.columnName&&this.renameColumn(e,t.columnName),this.createDefault(e)):(this.dropDefault(e),e.columnName!=t.columnName&&this.renameColumn(e,t.columnName),this.put("^alter ^table %f ^alter ^column %i ",e,e.columnName,t.columnName),this.columnDefinition(t,{includeDefault:!1}),this.endCommand(),this.createDefault(e))}specialColumnOptions(e){e.isSparse&&this.put("^sparse ")}renameConstraint(e,t){"index"==e.constraintType?this.putCmd("^execute sp_rename '%f.%i', '%s', 'INDEX'",e,e.constraintName,t):this.putCmd("^execute sp_rename '%f', '%s', 'OBJECT'",{schemaName:e.schemaName,pureName:e.constraintName},t)}}o.prototype.renameView=o.prototype.renameObject,o.prototype.changeViewSchema=o.prototype.changeObjectSchema,o.prototype.renameProcedure=o.prototype.renameObject,o.prototype.changeProcedureSchema=o.prototype.changeObjectSchema,o.prototype.renameFunction=o.prototype.renameObject,o.prototype.changeFunctionSchema=o.prototype.changeObjectSchema,o.prototype.renameTrigger=o.prototype.renameObject,o.prototype.changeTriggerSchema=o.prototype.changeObjectSchema,o.prototype.renameTable=o.prototype.renameObject,o.prototype.changeTableSchema=o.prototype.changeObjectSchema,e.exports=o},function(e,t,n){n(307);const r=n(16),i=n(312),{DatabaseAnalyser:o}=n(78),{isTypeString:a,isTypeNumeric:s}=n(78);function u(e){switch(e.trim()){case"U":return"tables";case"V":return"views";case"P":return"procedures";case"IF":case"FN":case"TF":return"functions";case"TR":return"triggers";default:return null}}function c({isNullable:e,isIdentity:t,columnName:n,dataType:r,charMaxLength:i,numericPrecision:o,numericScale:u,defaultValue:c,defaultConstraint:l}){let p=r;return i&&a(r)&&(p=`${r}(${i<0?"MAX":i})`),o&&u&&s(r)&&(p=`${r}(${o},${u})`),{columnName:n,dataType:p,notNull:!e,autoIncrement:!!t,defaultValue:c,defaultConstraint:l}}e.exports=class extends o{constructor(e,t,n){super(e,t,n)}createQuery(e,t){if(!i[e])throw new Error(`Missing analyse file ${e}`);return super.createQuery(i[e],t)}async _computeSingleObjectId(){const{schemaName:e,pureName:t,typeField:n}=this.singleObjectFilter,r=e?`[${e}].[${t}]`:t,i=await this.driver.query(this.pool,`SELECT OBJECT_ID('${r}') AS id`);this.singleObjectId=i.rows[0].id}async _runAnalysis(){const e=await this.driver.query(this.pool,this.createQuery("tables",["tables"])),t=await this.driver.query(this.pool,this.createQuery("columns",["tables"])),n=await this.driver.query(this.pool,this.createQuery("primaryKeys",["tables"])),i=await this.driver.query(this.pool,this.createQuery("foreignKeys",["tables"])),a=await this.driver.query(this.pool,this.createQuery("getSchemas")),s=await this.driver.query(this.pool,this.createQuery("indexes",["tables"])),u=await this.driver.query(this.pool,this.createQuery("indexcols",["tables"])),l=await this.driver.query(this.pool,"SELECT SCHEMA_NAME() as name"),p=await this.driver.query(this.pool,this.createQuery("tableSizes")),f=a.rows,h=r.mapValues(r.keyBy(p.rows,"objectId"),"tableRowCount"),d=await this.driver.query(this.pool,this.createQuery("loadSqlCode",["views","procedures","functions","triggers"])),m=e=>d.rows.filter(t=>t.pureName==e.pureName&&t.schemaName==e.schemaName).map(e=>e.codeText).join(""),g=await this.driver.query(this.pool,this.createQuery("views",["views"])),v=await this.driver.query(this.pool,this.createQuery("programmables",["procedures","functions"])),y=await this.driver.query(this.pool,this.createQuery("viewColumns",["views"]));return{tables:e.rows.map(e=>({...e,contentHash:e.modifyDate&&e.modifyDate.toISOString(),columns:t.rows.filter(t=>t.objectId==e.objectId).map(c),primaryKey:o.extractPrimaryKeys(e,n.rows),foreignKeys:o.extractForeignKeys(e,i.rows),indexes:s.rows.filter(t=>t.object_id==e.objectId&&!t.is_unique_constraint).map(e=>({...r.pick(e,["constraintName","indexType","isUnique"]),columns:u.rows.filter(t=>t.object_id==e.object_id&&t.index_id==e.index_id).map(e=>({...r.pick(e,["columnName","isDescending","isIncludedColumn"])}))})),uniques:s.rows.filter(t=>t.object_id==e.objectId&&t.is_unique_constraint).map(e=>({...r.pick(e,["constraintName"]),columns:u.rows.filter(t=>t.object_id==e.object_id&&t.index_id==e.index_id).map(e=>({...r.pick(e,["columnName"])}))})),tableRowCount:h[e.objectId]})),views:g.rows.map(e=>({...e,contentHash:e.modifyDate&&e.modifyDate.toISOString(),createSql:m(e),columns:y.rows.filter(t=>t.objectId==e.objectId).map(c)})),procedures:v.rows.filter(e=>"P"==e.sqlObjectType.trim()).map(e=>({...e,contentHash:e.modifyDate&&e.modifyDate.toISOString(),createSql:m(e)})),functions:v.rows.filter(e=>["FN","IF","TF"].includes(e.sqlObjectType.trim())).map(e=>({...e,contentHash:e.modifyDate&&e.modifyDate.toISOString(),createSql:m(e)})),schemas:f,defaultSchema:l.rows[0]?l.rows[0].name:void 0}}async _getFastSnapshot(){const e=await this.driver.query(this.pool,this.createQuery("modifications")),t=await this.driver.query(this.pool,this.createQuery("tableSizes")),n=o.createEmptyStructure();for(const t of e.rows){const{type:e,objectId:r,modifyDate:i,schemaName:o,pureName:a}=t,s=u(e);s&&n[s]&&n[s].push({objectId:r,contentHash:i&&i.toISOString(),schemaName:o,pureName:a})}for(const e of t.rows){const t=(n.tables||[]).find(t=>t.objectId==e.objectId);t&&(t.tableRowCount=e.tableRowCount)}return n}}},function(e,t,n){var r=n(308).runInContext();e.exports=n(309)(r,r)},function(e,t,n){(function(e){var r;
429
+ */var r,i=n(6).parse,o=n(0),a=n(504)({exact:!0}),s=n(232),u=n(234).Store,c=n(506).MemoryCookieStore,l=n(236).pathMatch,p=n(507);try{r=n(66)}catch(e){console.warn("tough-cookie: can't load punycode; won't use punycode for domain normalization")}var f=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/,h=/[\x00-\x1F]/,d=["\n","\r","\0"],m=/[\x20-\x3A\x3C-\x7E]+/,g=/[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/,v={jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11},y=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],b=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function _(e,t,n,r){for(var i=0;i<e.length;){var o=e.charCodeAt(i);if(o<=47||o>=58)break;i++}return i<t||i>n?null:r||i==e.length?parseInt(e.substr(0,i),10):null}function w(e){var t=e.split(":"),n=[0,0,0];if(3!==t.length)return null;for(var r=0;r<3;r++){var i=2==r,o=_(t[r],1,2,i);if(null===o)return null;n[r]=o}return n}function E(e){e=String(e).substr(0,3).toLowerCase();var t=v[e];return t>=0?t:null}function S(e){if(e){var t=e.split(g);if(t){for(var n=null,r=null,i=null,o=null,a=null,s=null,u=0;u<t.length;u++){var c,l=t[u].trim();if(l.length)null===i&&(c=w(l))?(n=c[0],r=c[1],i=c[2]):null!==o||null===(c=_(l,1,2,!0))?null!==a||null===(c=E(l))?null===s&&null!==(c=_(l,2,4,!0))&&((s=c)>=70&&s<=99?s+=1900:s>=0&&s<=69&&(s+=2e3)):a=c:o=c}if(!(null===o||null===a||null===s||null===i||o<1||o>31||s<1601||n>23||r>59||i>59))return new Date(Date.UTC(s,a,o,n,r,i))}}}function k(e){var t=e.getUTCDate();t=t>=10?t:"0"+t;var n=e.getUTCHours();n=n>=10?n:"0"+n;var r=e.getUTCMinutes();r=r>=10?r:"0"+r;var i=e.getUTCSeconds();return i=i>=10?i:"0"+i,b[e.getUTCDay()]+", "+t+" "+y[e.getUTCMonth()]+" "+e.getUTCFullYear()+" "+n+":"+r+":"+i+" GMT"}function x(e){return null==e?null:(e=e.trim().replace(/^\./,""),r&&/[^\u0001-\u007f]/.test(e)&&(e=r.toASCII(e)),e.toLowerCase())}function T(e,t,n){if(null==e||null==t)return null;if(!1!==n&&(e=x(e),t=x(t)),e==t)return!0;if(a.test(e))return!1;var r=e.indexOf(t);return!(r<=0)&&(e.length===t.length+r&&"."===e.substr(r-1,1))}function O(e){if(!e||"/"!==e.substr(0,1))return"/";if("/"===e)return e;var t=e.lastIndexOf("/");return 0===t?"/":e.slice(0,t)}function A(e,t){var n,r,i=(e=function(e){for(var t=0;t<d.length;t++){var n=e.indexOf(d[t]);-1!==n&&(e=e.substr(0,n))}return e}(e)).indexOf("=");if(t)0===i&&(i=(e=e.substr(1)).indexOf("="));else if(i<=0)return;if(i<=0?(n="",r=e.trim()):(n=e.substr(0,i).trim(),r=e.substr(i+1).trim()),!h.test(n)&&!h.test(r)){var o=new R;return o.key=n,o.value=r,o}}function N(e,t){t&&"object"==typeof t||(t={});var n=(e=e.trim()).indexOf(";"),r=A(-1===n?e:e.substr(0,n),!!t.loose);if(r){if(-1===n)return r;var i=e.slice(n+1).trim();if(0===i.length)return r;for(var o=i.split(";");o.length;){var a=o.shift().trim();if(0!==a.length){var s,u,c=a.indexOf("=");switch(-1===c?(s=a,u=null):(s=a.substr(0,c),u=a.substr(c+1)),s=s.trim().toLowerCase(),u&&(u=u.trim()),s){case"expires":if(u){var l=S(u);l&&(r.expires=l)}break;case"max-age":if(u&&/^-?[0-9]+$/.test(u)){var p=parseInt(u,10);r.setMaxAge(p)}break;case"domain":if(u){var f=u.trim().replace(/^\./,"");f&&(r.domain=f.toLowerCase())}break;case"path":r.path=u&&"/"===u[0]?u:null;break;case"secure":r.secure=!0;break;case"httponly":r.httpOnly=!0;break;default:r.extensions=r.extensions||[],r.extensions.push(a)}}}return r}}function I(e){var t;try{t=JSON.parse(e)}catch(e){return e}return t}function j(e){if(!e)return null;var t;if("string"==typeof e){if((t=I(e))instanceof Error)return null}else t=e;for(var n=new R,r=0;r<R.serializableProperties.length;r++){var i=R.serializableProperties[r];void 0!==t[i]&&t[i]!==R.prototype[i]&&("expires"===i||"creation"===i||"lastAccessed"===i?null===t[i]?n[i]=null:n[i]="Infinity"==t[i]?"Infinity":new Date(t[i]):n[i]=t[i])}return n}function C(e,t){var n=0,r=e.path?e.path.length:0;return 0!==(n=(t.path?t.path.length:0)-r)?n:0!==(n=(e.creation?e.creation.getTime():2147483647e3)-(t.creation?t.creation.getTime():2147483647e3))?n:n=e.creationIndex-t.creationIndex}function D(e){if(e instanceof Object)return e;try{e=decodeURI(e)}catch(e){}return i(e)}function R(e){e=e||{},Object.keys(e).forEach((function(t){R.prototype.hasOwnProperty(t)&&R.prototype[t]!==e[t]&&"_"!==t.substr(0,1)&&(this[t]=e[t])}),this),this.creation=this.creation||new Date,Object.defineProperty(this,"creationIndex",{configurable:!1,enumerable:!1,writable:!0,value:++R.cookiesCreated})}function P(e,t){"boolean"==typeof t?t={rejectPublicSuffixes:t}:null==t&&(t={}),null!=t.rejectPublicSuffixes&&(this.rejectPublicSuffixes=t.rejectPublicSuffixes),null!=t.looseMode&&(this.enableLooseMode=t.looseMode),e||(e=new c),this.store=e}R.cookiesCreated=0,R.parse=N,R.fromJSON=j,R.prototype.key="",R.prototype.value="",R.prototype.expires="Infinity",R.prototype.maxAge=null,R.prototype.domain=null,R.prototype.path=null,R.prototype.secure=!1,R.prototype.httpOnly=!1,R.prototype.extensions=null,R.prototype.hostOnly=null,R.prototype.pathIsDefault=null,R.prototype.creation=null,R.prototype.lastAccessed=null,Object.defineProperty(R.prototype,"creationIndex",{configurable:!0,enumerable:!1,writable:!0,value:0}),R.serializableProperties=Object.keys(R.prototype).filter((function(e){return!(R.prototype[e]instanceof Function||"creationIndex"===e||"_"===e.substr(0,1))})),R.prototype.inspect=function(){var e=Date.now();return'Cookie="'+this.toString()+"; hostOnly="+(null!=this.hostOnly?this.hostOnly:"?")+"; aAge="+(this.lastAccessed?e-this.lastAccessed.getTime()+"ms":"?")+"; cAge="+(this.creation?e-this.creation.getTime()+"ms":"?")+'"'},o.inspect.custom&&(R.prototype[o.inspect.custom]=R.prototype.inspect),R.prototype.toJSON=function(){for(var e={},t=R.serializableProperties,n=0;n<t.length;n++){var r=t[n];this[r]!==R.prototype[r]&&("expires"===r||"creation"===r||"lastAccessed"===r?null===this[r]?e[r]=null:e[r]="Infinity"==this[r]?"Infinity":this[r].toISOString():"maxAge"===r?null!==this[r]&&(e[r]=this[r]==1/0||this[r]==-1/0?this[r].toString():this[r]):this[r]!==R.prototype[r]&&(e[r]=this[r]))}return e},R.prototype.clone=function(){return j(this.toJSON())},R.prototype.validate=function(){if(!f.test(this.value))return!1;if(!(this.expires==1/0||this.expires instanceof Date||S(this.expires)))return!1;if(null!=this.maxAge&&this.maxAge<=0)return!1;if(null!=this.path&&!m.test(this.path))return!1;var e=this.cdomain();if(e){if(e.match(/\.$/))return!1;if(null==s.getPublicSuffix(e))return!1}return!0},R.prototype.setExpires=function(e){e instanceof Date?this.expires=e:this.expires=S(e)||"Infinity"},R.prototype.setMaxAge=function(e){this.maxAge=e===1/0||e===-1/0?e.toString():e},R.prototype.cookieString=function(){var e=this.value;return null==e&&(e=""),""===this.key?e:this.key+"="+e},R.prototype.toString=function(){var e=this.cookieString();return this.expires!=1/0&&(this.expires instanceof Date?e+="; Expires="+k(this.expires):e+="; Expires="+this.expires),null!=this.maxAge&&this.maxAge!=1/0&&(e+="; Max-Age="+this.maxAge),this.domain&&!this.hostOnly&&(e+="; Domain="+this.domain),this.path&&(e+="; Path="+this.path),this.secure&&(e+="; Secure"),this.httpOnly&&(e+="; HttpOnly"),this.extensions&&this.extensions.forEach((function(t){e+="; "+t})),e},R.prototype.TTL=function(e){if(null!=this.maxAge)return this.maxAge<=0?0:1e3*this.maxAge;var t=this.expires;return t!=1/0?(t instanceof Date||(t=S(t)||1/0),t==1/0?1/0:t.getTime()-(e||Date.now())):1/0},R.prototype.expiryTime=function(e){if(null!=this.maxAge){var t=e||this.creation||new Date,n=this.maxAge<=0?-1/0:1e3*this.maxAge;return t.getTime()+n}return this.expires==1/0?1/0:this.expires.getTime()},R.prototype.expiryDate=function(e){var t=this.expiryTime(e);return t==1/0?new Date(2147483647e3):t==-1/0?new Date(0):new Date(t)},R.prototype.isPersistent=function(){return null!=this.maxAge||this.expires!=1/0},R.prototype.cdomain=R.prototype.canonicalizedDomain=function(){return null==this.domain?null:x(this.domain)},P.prototype.store=null,P.prototype.rejectPublicSuffixes=!0,P.prototype.enableLooseMode=!1;var F=[];function L(e){return function(){if(!this.store.synchronous)throw new Error("CookieJar store is not synchronous; use async API instead.");var t,n,r=Array.prototype.slice.call(arguments);if(r.push((function(e,r){t=e,n=r})),this[e].apply(this,r),t)throw t;return n}}F.push("setCookie"),P.prototype.setCookie=function(e,t,n,r){var i,o=D(t);n instanceof Function&&(r=n,n={});var a=x(o.hostname),u=this.enableLooseMode;if(null!=n.loose&&(u=n.loose),"string"==typeof e||e instanceof String){if(!(e=R.parse(e,{loose:u})))return i=new Error("Cookie failed to parse"),r(n.ignoreError?null:i)}else if(!(e instanceof R))return i=new Error("First argument to setCookie must be a Cookie object or string"),r(n.ignoreError?null:i);var c=n.now||new Date;if(this.rejectPublicSuffixes&&e.domain&&null==s.getPublicSuffix(e.cdomain()))return i=new Error("Cookie has domain set to a public suffix"),r(n.ignoreError?null:i);if(e.domain){if(!T(a,e.cdomain(),!1))return i=new Error("Cookie not in this host's domain. Cookie:"+e.cdomain()+" Request:"+a),r(n.ignoreError?null:i);null==e.hostOnly&&(e.hostOnly=!1)}else e.hostOnly=!0,e.domain=a;if(e.path&&"/"===e.path[0]||(e.path=O(o.pathname),e.pathIsDefault=!0),!1===n.http&&e.httpOnly)return i=new Error("Cookie is HttpOnly and this isn't an HTTP API"),r(n.ignoreError?null:i);var l=this.store;l.updateCookie||(l.updateCookie=function(e,t,n){this.putCookie(t,n)}),l.findCookie(e.domain,e.path,e.key,(function(t,i){if(t)return r(t);var o=function(t){if(t)return r(t);r(null,e)};if(i){if(!1===n.http&&i.httpOnly)return t=new Error("old Cookie is HttpOnly and this isn't an HTTP API"),r(n.ignoreError?null:t);e.creation=i.creation,e.creationIndex=i.creationIndex,e.lastAccessed=c,l.updateCookie(i,e,o)}else e.creation=e.lastAccessed=c,l.putCookie(e,o)}))},F.push("getCookies"),P.prototype.getCookies=function(e,t,n){var r=D(e);t instanceof Function&&(n=t,t={});var i=x(r.hostname),o=r.pathname||"/",a=t.secure;null!=a||!r.protocol||"https:"!=r.protocol&&"wss:"!=r.protocol||(a=!0);var s=t.http;null==s&&(s=!0);var u=t.now||Date.now(),c=!1!==t.expire,p=!!t.allPaths,f=this.store;function h(e){if(e.hostOnly){if(e.domain!=i)return!1}else if(!T(i,e.domain,!1))return!1;return!(!p&&!l(o,e.path))&&(!(e.secure&&!a)&&(!(e.httpOnly&&!s)&&(!(c&&e.expiryTime()<=u)||(f.removeCookie(e.domain,e.path,e.key,(function(){})),!1))))}f.findCookies(i,p?null:o,(function(e,r){if(e)return n(e);r=r.filter(h),!1!==t.sort&&(r=r.sort(C));var i=new Date;r.forEach((function(e){e.lastAccessed=i})),n(null,r)}))},F.push("getCookieString"),P.prototype.getCookieString=function(){var e=Array.prototype.slice.call(arguments,0),t=e.pop(),n=function(e,n){e?t(e):t(null,n.sort(C).map((function(e){return e.cookieString()})).join("; "))};e.push(n),this.getCookies.apply(this,e)},F.push("getSetCookieStrings"),P.prototype.getSetCookieStrings=function(){var e=Array.prototype.slice.call(arguments,0),t=e.pop(),n=function(e,n){e?t(e):t(null,n.map((function(e){return e.toString()})))};e.push(n),this.getCookies.apply(this,e)},F.push("serialize"),P.prototype.serialize=function(e){var t=this.store.constructor.name;"Object"===t&&(t=null);var n={version:"tough-cookie@"+p,storeType:t,rejectPublicSuffixes:!!this.rejectPublicSuffixes,cookies:[]};if(!this.store.getAllCookies||"function"!=typeof this.store.getAllCookies)return e(new Error("store does not support getAllCookies and cannot be serialized"));this.store.getAllCookies((function(t,r){return t?e(t):(n.cookies=r.map((function(e){return delete(e=e instanceof R?e.toJSON():e).creationIndex,e})),e(null,n))}))},P.prototype.toJSON=function(){return this.serializeSync()},F.push("_importCookies"),P.prototype._importCookies=function(e,t){var n=this,r=e.cookies;if(!r||!Array.isArray(r))return t(new Error("serialized jar has no cookies array"));r=r.slice(),function e(i){if(i)return t(i);if(!r.length)return t(i,n);var o;try{o=j(r.shift())}catch(e){return t(e)}if(null===o)return e(null);n.store.putCookie(o,e)}()},P.deserialize=function(e,t,n){var r;if(3!==arguments.length&&(n=t,t=null),"string"==typeof e){if((r=I(e))instanceof Error)return n(r)}else r=e;var i=new P(t,r.rejectPublicSuffixes);i._importCookies(r,(function(e){if(e)return n(e);n(null,i)}))},P.deserializeSync=function(e,t){var n="string"==typeof e?JSON.parse(e):e,r=new P(t,n.rejectPublicSuffixes);if(!r.store.synchronous)throw new Error("CookieJar store is not synchronous; use async API instead.");return r._importCookiesSync(n),r},P.fromJSON=P.deserializeSync,P.prototype.clone=function(e,t){1===arguments.length&&(t=e,e=null),this.serialize((function(n,r){if(n)return t(n);P.deserialize(r,e,t)}))},F.push("removeAllCookies"),P.prototype.removeAllCookies=function(e){var t=this.store;if(t.removeAllCookies instanceof Function&&t.removeAllCookies!==u.prototype.removeAllCookies)return t.removeAllCookies(e);t.getAllCookies((function(n,r){if(n)return e(n);if(0===r.length)return e(null);var i=0,o=[];function a(t){if(t&&o.push(t),++i===r.length)return e(o.length?o[0]:null)}r.forEach((function(e){t.removeCookie(e.domain,e.path,e.key,a)}))}))},P.prototype._cloneSync=L("clone"),P.prototype.cloneSync=function(e){if(!e.synchronous)throw new Error("CookieJar clone destination store is not synchronous; use async API instead.");return this._cloneSync(e)},F.forEach((function(e){P.prototype[e+"Sync"]=L(e)})),t.version=p,t.CookieJar=P,t.Cookie=R,t.Store=u,t.MemoryCookieStore=c,t.parseDate=S,t.formatDate=k,t.parse=N,t.fromJSON=j,t.domainMatch=T,t.defaultPath=O,t.pathMatch=l,t.getPublicSuffix=s.getPublicSuffix,t.cookieCompare=C,t.permuteDomain=n(235).permuteDomain,t.permutePath=function(e){if("/"===e)return["/"];e.lastIndexOf("/")===e.length-1&&(e=e.substr(0,e.length-1));for(var t=[e];e.length>1;){var n=e.lastIndexOf("/");if(0===n)break;e=e.substr(0,n),t.push(e)}return t.push("/"),t},t.canonicalDomain=x},function(e,t,n){var r=n(138),i=n(0),o=n(96),a=n(19),s=n(25),u=n(6).parse,c=n(67),l=n(139),p=n(237),f=n(515);function h(e){if(!(this instanceof h))return new h;for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],r.call(this),e=e||{})this[t]=e[t]}e.exports=h,i.inherits(h,r),h.LINE_BREAK="\r\n",h.DEFAULT_CONTENT_TYPE="application/octet-stream",h.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var o=r.prototype.append.bind(this);if("number"==typeof t&&(t=""+t),i.isArray(t))this._error(new Error("Arrays are not supported."));else{var a=this._multiPartHeader(e,t,n),s=this._multiPartFooter();o(a),o(t),o(s),this._trackLength(a,t,n)}},h.prototype._trackLength=function(e,t,n){var r=0;null!=n.knownLength?r+=+n.knownLength:Buffer.isBuffer(t)?r=t.length:"string"==typeof t&&(r=Buffer.byteLength(t)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(e)+h.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion"))&&(n.knownLength||this._valuesToMeasure.push(t))},h.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):c.stat(e.path,(function(n,r){var i;n?t(n):(i=r.size-(e.start?e.start:0),t(null,i))})):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(n){e.pause(),t(null,+n.headers["content-length"])})),e.resume()):t("Unknown stream")},h.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var r,i=this._getContentDisposition(t,n),o=this._getContentType(t,n),a="",s={"Content-Disposition":["form-data",'name="'+e+'"'].concat(i||[]),"Content-Type":[].concat(o||[])};for(var u in"object"==typeof n.header&&f(s,n.header),s)s.hasOwnProperty(u)&&null!=(r=s[u])&&(Array.isArray(r)||(r=[r]),r.length&&(a+=u+": "+r.join("; ")+h.LINE_BREAK));return"--"+this.getBoundary()+h.LINE_BREAK+a+h.LINE_BREAK},h.prototype._getContentDisposition=function(e,t){var n,r;return"string"==typeof t.filepath?n=o.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?n=o.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(n=o.basename(e.client._httpMessage.path||"")),n&&(r='filename="'+n+'"'),r},h.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e.name&&(n=l.lookup(e.name)),!n&&e.path&&(n=l.lookup(e.path)),!n&&e.readable&&e.hasOwnProperty("httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=l.lookup(t.filepath||t.filename)),n||"object"!=typeof e||(n=h.DEFAULT_CONTENT_TYPE),n},h.prototype._multiPartFooter=function(){return function(e){var t=h.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},h.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+h.LINE_BREAK},h.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(n[t.toLowerCase()]=e[t]);return n},h.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},h.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,r=this._streams.length;n<r;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(h.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},h.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},h.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},h.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},h.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?p.parallel(this._valuesToMeasure,this._lengthRetriever,(function(n,r){n?e(n):(r.forEach((function(e){t+=e})),e(null,t))})):process.nextTick(e.bind(this,null,t))},h.prototype.submit=function(e,t){var n,r,i={method:"post"};return"string"==typeof e?(e=u(e),r=f({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(r=f(e,i)).port||(r.port="https:"==r.protocol?443:80),r.headers=this.getHeaders(e.headers),n="https:"==r.protocol?s.request(r):a.request(r),this.getLength(function(e,r){e?this._error(e):(n.setHeader("Content-Length",r),this.pipe(n),t&&(n.on("error",t),n.on("response",t.bind(this,null))))}.bind(this)),n},h.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},h.prototype.toString=function(){return"[object FormData]"}},,function(e,t,n){const r=n(303);e.exports={packageName:"dbgate-plugin-mssql",drivers:[r],initialize(e){r.initialize(e)}}},function(e,t,n){n(16);const r=n(2),i=n(304),o=n(306),a=n(493),s=n(736),u=n(737),c=n(739),l=new u,{tediousConnect:p,tediousQueryCore:f,tediousReadQuery:h,tediousStream:d}=n(740),{nativeConnect:m,nativeQueryCore:g,nativeReadQuery:v,nativeStream:y}=c;let b;const _=[{title:"Windows",name:"sspi",disabledFields:["password","port","user"]},{title:"SQL Server",name:"sql",disabledFields:["port"]},{title:"NodeJs portable driver (tedious)",name:"tedious"}],w={...i,analyserClass:o,getAuthTypes:()=>b?_:null,async connect(e){const{authType:t}=e;return!b||"sspi"!=t&&"sql"!=t?p(e):m(e)},close:async e=>e.close(),queryCore:async(e,t,n)=>"msnodesqlv8"==e._connectionType?g(e,t,n):f(e,t,n),async query(e,t,n){return l.acquire("connection",async()=>this.queryCore(e,t,n))},stream:async(e,t,n)=>"msnodesqlv8"==e._connectionType?y(e,t,n):d(e,t,n),readQuery:async(e,t,n)=>"msnodesqlv8"==e._connectionType?v(e,t,n):h(e,t,n),async writeTable(e,t,n){return"msnodesqlv8"==e._connectionType?s(this,r,e,t,n):a(this,r,e,t,n)},async getVersion(e){const t=(await this.query(e,"\nSELECT \n @@VERSION AS version, \n SERVERPROPERTY ('productversion') as productVersion,\n CASE \n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '8%' THEN 'SQL Server 2000'\n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '9%' THEN 'SQL Server 2005'\n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '10.0%' THEN 'SQL Server 2008'\n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '10.5%' THEN 'SQL Server 2008 R2'\n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '11%' THEN 'SQL Server 2012'\n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '12%' THEN 'SQL Server 2014'\n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '13%' THEN 'SQL Server 2016' \n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '14%' THEN 'SQL Server 2017' \n WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '15%' THEN 'SQL Server 2019' \n ELSE 'Unknown'\n END AS versionText\n")).rows[0];if(t.productVersion){const e=t.productVersion.split("."),n=parseInt(e[0])||0;t.productVersionNumber=n}else t.productVersionNumber=0;return t},async listDatabases(e){const{rows:t}=await this.query(e,"SELECT name FROM sys.databases order by name");return t}};w.initialize=e=>{e.nativeModules&&e.nativeModules.msnodesqlv8&&(b=e.nativeModules.msnodesqlv8()),c.initialize(e)},e.exports=w},function(e,t,n){const{driverBase:r}=global.DBGATE_TOOLS,i=n(305),{mssqlSplitterOptions:o}=n(107),a={limitSelect:!0,rangeSelect:!0,offsetFetchRangeSyntax:!0,rowNumberOverPaging:!0,stringEscapeChar:"'",fallbackDataType:"nvarchar(max)",explicitDropConstraint:!1,enableConstraintsPerTable:!0,dropColumnDependencies:["default","dependencies","indexes","primaryKey","foreignKeys","uniques"],changeColumnDependencies:["indexes","dependencies","uniques"],anonymousPrimaryKey:!1,dropIndexContainsTableSpec:!0,quoteIdentifier:e=>`[${e}]`,createColumn:!0,dropColumn:!0,changeColumn:!0,createIndex:!0,dropIndex:!0,createForeignKey:!0,dropForeignKey:!0,createPrimaryKey:!0,dropPrimaryKey:!0,createUnique:!0,dropUnique:!0,createCheck:!0,dropCheck:!0,dropReferencesWhenDropTable:!0,columnProperties:{isSparse:!0,isPersisted:!0},predefinedDataTypes:["bigint","bit","decimal(10,2)","int","money","numeric","smallint","smallmoney","tinyint","float","real","date","datetime2","datetime","datetimeofffset","smalldatetime","time","char(20)","varchar(250)","text","nchar(20)","nvarchar(250)","ntext","binary(100)","varbinary(100)","image","xml"]},s={...r,dumperClass:i,dialect:a,readOnlySessions:!1,dialectByVersion:e=>e&&e.productVersionNumber<11?{...a,rangeSelect:!1,offsetFetchRangeSyntax:!1}:a,showConnectionField:(e,t)=>["authType","server","port","user","password","defaultDatabase","singleDatabase","isReadOnly"].includes(e),getQuerySplitterOptions:()=>o,engine:"mssql@dbgate-plugin-mssql",title:"Microsoft SQL Server",defaultPort:1433,defaultAuthTypeName:"tedious",getNewObjectTemplates:()=>[{label:"New view",sql:"CREATE VIEW myview\nAS\nSELECT * FROM table1"},{label:"New procedure",sql:"CREATE PROCEDURE myproc (@arg1 INT)\nAS\nBEGIN\n SELECT * FROM table1\nEND"},{label:"New function",sql:"CREATE FUNCTION myfunc (@arg1 INT) RETURNS INT\nAS\nBEGIN\n RETURN 1;\nEND"},{label:"New table valued function",sql:"CREATE FUNCTION myfunc (@arg1 INT) RETURNS TABLE \nAS\nRETURN SELECT * FROM table1"}]};e.exports=s},function(e,t){const{SqlDumper:n,testEqualColumns:r,arrayToHexString:i}=global.DBGATE_TOOLS;class o extends n{constructor(e,t){super(e),t&&t.useHardSeparator&&(this.useHardSeparator=!0)}endCommand(){this.useHardSeparator?this.putRaw("\nGO\n"):super.endCommand()}autoIncrement(){this.put(" ^identity")}putStringValue(e){/[^\u0000-\u00ff]/.test(e)&&this.putRaw("N"),super.putStringValue(e)}putByteArrayValue(e){super.putRaw("0x"+i(e))}allowIdentityInsert(e,t){this.putCmd("^set ^identity_insert %f %k",e,t?"on":"off")}transform(e,t){switch(e){case"GROUP:YEAR":case"YEAR":this.put("^datepart(^year, %c)",t);break;case"MONTH":this.put("^datepart(^month, %c)",t);break;case"DAY":this.put("^datepart(^day, %c)",t);break;case"GROUP:MONTH":this.put("^convert(^varchar(100), ^datepart(^year, %c)) + '-' + right('0' + ^convert(^varchar(100), ^datepart(^month, %c)), 2)",t,t);break;case"GROUP:DAY":this.put("^^convert(^varchar(100), ^datepart(^year, %c)) + '-' + ^right('0' + ^convert(^varchar(100), ^datepart(^month, %c)), 2)+'-' + ^right('0' + ^convert(^varchar(100), ^datepart(^day, %c)), 2)",t,t,t);break;default:t()}}renameObject(e,t){this.putCmd("^execute sp_rename '%f', '%s', 'OBJECT'",e,t)}changeObjectSchema(e,t){this.putCmd("^execute sp_changeobjectowner '%f', '%s'",e,t)}dropTable(e,t={}){t.testIfExists&&this.put("IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'%f') AND type in (N'U'))&n",e),super.dropTable(e,t)}dropColumn(e){e.defaultConstraint&&this.putCmd("^alter ^table %f ^drop ^constraint %i",e,e.defaultConstraint),super.dropColumn(e)}dropDefault(e){e.defaultConstraint&&this.putCmd("^alter ^table %f ^drop ^constraint %i",e,e.defaultConstraint)}guessDefaultName(e){return e.defaultConstraint||`DF${e.schemaName||"dbo"}_${e.pureName}_col.columnName`}createDefault(e){if(!e.defaultValue)return;const t=e.defaultValue;if(!t){const n=this.guessDefaultName(e);this.putCmd("^alter ^table %f ^add ^constraint %i ^default %s for %i",e,n,t,e.columnName)}}renameColumn(e,t){this.putCmd("^execute sp_rename '%f.%i', '%s', 'COLUMN'",e,e.columnName,t)}changeColumn(e,t,n){r(e,t,!1,!1)?(this.dropDefault(e),e.columnName!=t.columnName&&this.renameColumn(e,t.columnName),this.createDefault(e)):(this.dropDefault(e),e.columnName!=t.columnName&&this.renameColumn(e,t.columnName),this.put("^alter ^table %f ^alter ^column %i ",e,e.columnName,t.columnName),this.columnDefinition(t,{includeDefault:!1}),this.endCommand(),this.createDefault(e))}specialColumnOptions(e){e.isSparse&&this.put("^sparse ")}renameConstraint(e,t){"index"==e.constraintType?this.putCmd("^execute sp_rename '%f.%i', '%s', 'INDEX'",e,e.constraintName,t):this.putCmd("^execute sp_rename '%f', '%s', 'OBJECT'",{schemaName:e.schemaName,pureName:e.constraintName},t)}}o.prototype.renameView=o.prototype.renameObject,o.prototype.changeViewSchema=o.prototype.changeObjectSchema,o.prototype.renameProcedure=o.prototype.renameObject,o.prototype.changeProcedureSchema=o.prototype.changeObjectSchema,o.prototype.renameFunction=o.prototype.renameObject,o.prototype.changeFunctionSchema=o.prototype.changeObjectSchema,o.prototype.renameTrigger=o.prototype.renameObject,o.prototype.changeTriggerSchema=o.prototype.changeObjectSchema,o.prototype.renameTable=o.prototype.renameObject,o.prototype.changeTableSchema=o.prototype.changeObjectSchema,e.exports=o},function(e,t,n){n(307);const r=n(16),i=n(312),{DatabaseAnalyser:o}=n(78),{isTypeString:a,isTypeNumeric:s}=n(78);function u(e){switch(e.trim()){case"U":return"tables";case"V":return"views";case"P":return"procedures";case"IF":case"FN":case"TF":return"functions";case"TR":return"triggers";default:return null}}function c({isNullable:e,isIdentity:t,columnName:n,dataType:r,charMaxLength:i,numericPrecision:o,numericScale:u,defaultValue:c,defaultConstraint:l}){let p=r;return i&&a(r)&&(p=`${r}(${i<0?"MAX":i})`),o&&u&&s(r)&&(p=`${r}(${o},${u})`),{columnName:n,dataType:p,notNull:!e,autoIncrement:!!t,defaultValue:c,defaultConstraint:l}}e.exports=class extends o{constructor(e,t,n){super(e,t,n)}createQuery(e,t){if(!i[e])throw new Error(`Missing analyse file ${e}`);return super.createQuery(i[e],t)}async _computeSingleObjectId(){const{schemaName:e,pureName:t,typeField:n}=this.singleObjectFilter,r=e?`[${e}].[${t}]`:t,i=await this.driver.query(this.pool,`SELECT OBJECT_ID('${r}') AS id`);this.singleObjectId=i.rows[0].id}async _runAnalysis(){const e=await this.driver.query(this.pool,this.createQuery("tables",["tables"])),t=await this.driver.query(this.pool,this.createQuery("columns",["tables"])),n=await this.driver.query(this.pool,this.createQuery("primaryKeys",["tables"])),i=await this.driver.query(this.pool,this.createQuery("foreignKeys",["tables"])),a=await this.driver.query(this.pool,this.createQuery("getSchemas")),s=await this.driver.query(this.pool,this.createQuery("indexes",["tables"])),u=await this.driver.query(this.pool,this.createQuery("indexcols",["tables"])),l=await this.driver.query(this.pool,"SELECT SCHEMA_NAME() as name"),p=await this.driver.query(this.pool,this.createQuery("tableSizes")),f=a.rows,h=r.mapValues(r.keyBy(p.rows,"objectId"),"tableRowCount"),d=await this.driver.query(this.pool,this.createQuery("loadSqlCode",["views","procedures","functions","triggers"])),m=e=>d.rows.filter(t=>t.pureName==e.pureName&&t.schemaName==e.schemaName).map(e=>e.codeText).join(""),g=await this.driver.query(this.pool,this.createQuery("views",["views"])),v=await this.driver.query(this.pool,this.createQuery("programmables",["procedures","functions"])),y=await this.driver.query(this.pool,this.createQuery("viewColumns",["views"]));return{tables:e.rows.map(e=>({...e,contentHash:e.modifyDate&&e.modifyDate.toISOString(),columns:t.rows.filter(t=>t.objectId==e.objectId).map(c),primaryKey:o.extractPrimaryKeys(e,n.rows),foreignKeys:o.extractForeignKeys(e,i.rows),indexes:s.rows.filter(t=>t.object_id==e.objectId&&!t.is_unique_constraint).map(e=>({...r.pick(e,["constraintName","indexType","isUnique"]),columns:u.rows.filter(t=>t.object_id==e.object_id&&t.index_id==e.index_id).map(e=>({...r.pick(e,["columnName","isDescending","isIncludedColumn"])}))})),uniques:s.rows.filter(t=>t.object_id==e.objectId&&t.is_unique_constraint).map(e=>({...r.pick(e,["constraintName"]),columns:u.rows.filter(t=>t.object_id==e.object_id&&t.index_id==e.index_id).map(e=>({...r.pick(e,["columnName"])}))})),tableRowCount:h[e.objectId]})),views:g.rows.map(e=>({...e,contentHash:e.modifyDate&&e.modifyDate.toISOString(),createSql:m(e),columns:y.rows.filter(t=>t.objectId==e.objectId).map(c)})),procedures:v.rows.filter(e=>"P"==e.sqlObjectType.trim()).map(e=>({...e,contentHash:e.modifyDate&&e.modifyDate.toISOString(),createSql:m(e)})),functions:v.rows.filter(e=>["FN","IF","TF"].includes(e.sqlObjectType.trim())).map(e=>({...e,contentHash:e.modifyDate&&e.modifyDate.toISOString(),createSql:m(e)})),schemas:f,defaultSchema:l.rows[0]?l.rows[0].name:void 0}}async _getFastSnapshot(){const e=await this.driver.query(this.pool,this.createQuery("modifications")),t=await this.driver.query(this.pool,this.createQuery("tableSizes")),n=o.createEmptyStructure();for(const t of e.rows){const{type:e,objectId:r,modifyDate:i,schemaName:o,pureName:a}=t,s=u(e);s&&n[s]&&n[s].push({objectId:r,contentHash:i&&i.toISOString(),schemaName:o,pureName:a})}for(const e of t.rows){const t=(n.tables||[]).find(t=>t.objectId==e.objectId);t&&(t.tableRowCount=e.tableRowCount)}return n}}},function(e,t,n){var r=n(308).runInContext();e.exports=n(309)(r,r)},function(e,t,n){(function(e){var r;
430
430
  /**
431
431
  * @license
432
432
  * Lodash <https://lodash.com/>
package/dist/frontend.js CHANGED
@@ -1 +1 @@
1
- var plugin=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){const{driverBase:r}=window.DBGATE_TOOLS,a=n(2),{mssqlSplitterOptions:s}=n(3),i={limitSelect:!0,rangeSelect:!0,offsetFetchRangeSyntax:!0,rowNumberOverPaging:!0,stringEscapeChar:"'",fallbackDataType:"nvarchar(max)",explicitDropConstraint:!1,enableConstraintsPerTable:!0,dropColumnDependencies:["default","dependencies","indexes","primaryKey","foreignKeys","uniques"],changeColumnDependencies:["indexes","dependencies","uniques"],anonymousPrimaryKey:!1,dropIndexContainsTableSpec:!0,quoteIdentifier:e=>`[${e}]`,createColumn:!0,dropColumn:!0,changeColumn:!0,createIndex:!0,dropIndex:!0,createForeignKey:!0,dropForeignKey:!0,createPrimaryKey:!0,dropPrimaryKey:!0,createUnique:!0,dropUnique:!0,createCheck:!0,dropCheck:!0,dropReferencesWhenDropTable:!0,columnProperties:{isSparse:!0,isPersisted:!0}},o={...r,dumperClass:a,dialect:i,readOnlySessions:!1,dialectByVersion:e=>e&&e.productVersionNumber<11?{...i,rangeSelect:!1,offsetFetchRangeSyntax:!1}:i,showConnectionField:(e,t)=>["authType","server","port","user","password","defaultDatabase","singleDatabase","isReadOnly"].includes(e),getQuerySplitterOptions:()=>s,engine:"mssql@dbgate-plugin-mssql",title:"Microsoft SQL Server",defaultPort:1433,defaultAuthTypeName:"tedious",getNewObjectTemplates:()=>[{label:"New view",sql:"CREATE VIEW myview\nAS\nSELECT * FROM table1"},{label:"New procedure",sql:"CREATE PROCEDURE myproc (@arg1 INT)\nAS\nBEGIN\n SELECT * FROM table1\nEND"},{label:"New function",sql:"CREATE FUNCTION myfunc (@arg1 INT) RETURNS INT\nAS\nBEGIN\n RETURN 1;\nEND"},{label:"New table valued function",sql:"CREATE FUNCTION myfunc (@arg1 INT) RETURNS TABLE \nAS\nRETURN SELECT * FROM table1"}]};e.exports=o},function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r);t.default={drivers:[a.a]}},function(e,t){const{SqlDumper:n,testEqualColumns:r,arrayToHexString:a}=window.DBGATE_TOOLS;class s extends n{constructor(e,t){super(e),t&&t.useHardSeparator&&(this.useHardSeparator=!0)}endCommand(){this.useHardSeparator?this.putRaw("\nGO\n"):super.endCommand()}autoIncrement(){this.put(" ^identity")}putStringValue(e){/[^\u0000-\u00ff]/.test(e)&&this.putRaw("N"),super.putStringValue(e)}putByteArrayValue(e){super.putRaw("0x"+a(e))}allowIdentityInsert(e,t){this.putCmd("^set ^identity_insert %f %k",e,t?"on":"off")}transform(e,t){switch(e){case"GROUP:YEAR":case"YEAR":this.put("^datepart(^year, %c)",t);break;case"MONTH":this.put("^datepart(^month, %c)",t);break;case"DAY":this.put("^datepart(^day, %c)",t);break;case"GROUP:MONTH":this.put("^convert(^varchar(100), ^datepart(^year, %c)) + '-' + right('0' + ^convert(^varchar(100), ^datepart(^month, %c)), 2)",t,t);break;case"GROUP:DAY":this.put("^^convert(^varchar(100), ^datepart(^year, %c)) + '-' + ^right('0' + ^convert(^varchar(100), ^datepart(^month, %c)), 2)+'-' + ^right('0' + ^convert(^varchar(100), ^datepart(^day, %c)), 2)",t,t,t);break;default:t()}}renameObject(e,t){this.putCmd("^execute sp_rename '%f', '%s', 'OBJECT'",e,t)}changeObjectSchema(e,t){this.putCmd("^execute sp_changeobjectowner '%f', '%s'",e,t)}dropTable(e,t={}){t.testIfExists&&this.put("IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'%f') AND type in (N'U'))&n",e),super.dropTable(e,t)}dropColumn(e){e.defaultConstraint&&this.putCmd("^alter ^table %f ^drop ^constraint %i",e,e.defaultConstraint),super.dropColumn(e)}dropDefault(e){e.defaultConstraint&&this.putCmd("^alter ^table %f ^drop ^constraint %i",e,e.defaultConstraint)}guessDefaultName(e){return e.defaultConstraint||`DF${e.schemaName||"dbo"}_${e.pureName}_col.columnName`}createDefault(e){if(!e.defaultValue)return;const t=e.defaultValue;if(!t){const n=this.guessDefaultName(e);this.putCmd("^alter ^table %f ^add ^constraint %i ^default %s for %i",e,n,t,e.columnName)}}renameColumn(e,t){this.putCmd("^execute sp_rename '%f.%i', '%s', 'COLUMN'",e,e.columnName,t)}changeColumn(e,t,n){r(e,t,!1,!1)?(this.dropDefault(e),e.columnName!=t.columnName&&this.renameColumn(e,t.columnName),this.createDefault(e)):(this.dropDefault(e),e.columnName!=t.columnName&&this.renameColumn(e,t.columnName),this.put("^alter ^table %f ^alter ^column %i ",e,e.columnName,t.columnName),this.columnDefinition(t,{includeDefault:!1}),this.endCommand(),this.createDefault(e))}specialColumnOptions(e){e.isSparse&&this.put("^sparse ")}renameConstraint(e,t){"index"==e.constraintType?this.putCmd("^execute sp_rename '%f.%i', '%s', 'INDEX'",e,e.constraintName,t):this.putCmd("^execute sp_rename '%f', '%s', 'OBJECT'",{schemaName:e.schemaName,pureName:e.constraintName},t)}}s.prototype.renameView=s.prototype.renameObject,s.prototype.changeViewSchema=s.prototype.changeObjectSchema,s.prototype.renameProcedure=s.prototype.renameObject,s.prototype.changeProcedureSchema=s.prototype.changeObjectSchema,s.prototype.renameFunction=s.prototype.renameObject,s.prototype.changeFunctionSchema=s.prototype.changeObjectSchema,s.prototype.renameTrigger=s.prototype.renameObject,s.prototype.changeTriggerSchema=s.prototype.changeObjectSchema,s.prototype.renameTable=s.prototype.renameObject,s.prototype.changeTableSchema=s.prototype.changeObjectSchema,e.exports=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redisSplitterOptions=t.noSplitSplitterOptions=t.mongoSplitterOptions=t.sqliteSplitterOptions=t.postgreSplitterOptions=t.mssqlSplitterOptions=t.mysqlSplitterOptions=t.defaultSplitterOptions=void 0,t.defaultSplitterOptions={stringsBegins:["'"],stringsEnds:{"'":"'"},stringEscapes:{"'":"'"},allowSemicolon:!0,allowCustomDelimiter:!1,allowGoDelimiter:!1,allowDollarDollarString:!1,noSplit:!1,doubleDashComments:!0,multilineComments:!0,javaScriptComments:!1,returnRichInfo:!1,splitByLines:!1},t.mysqlSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{allowCustomDelimiter:!0,stringsBegins:["'","`"],stringsEnds:{"'":"'","`":"`"},stringEscapes:{"'":"\\","`":"`"}}),t.mssqlSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{allowSemicolon:!1,allowGoDelimiter:!0,stringsBegins:["'","["],stringsEnds:{"'":"'","[":"]"},stringEscapes:{"'":"'"}}),t.postgreSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{allowDollarDollarString:!0,stringsBegins:["'",'"'],stringsEnds:{"'":"'",'"':'"'},stringEscapes:{"'":"'",'"':'"'}}),t.sqliteSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{stringsBegins:["'",'"'],stringsEnds:{"'":"'",'"':'"'},stringEscapes:{"'":"'",'"':'"'}}),t.mongoSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{stringsBegins:["'",'"'],stringsEnds:{"'":"'",'"':'"'},stringEscapes:{"'":"\\",'"':"\\"}}),t.noSplitSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{noSplit:!0}),t.redisSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{splitByLines:!0})}]);
1
+ var plugin=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){const{driverBase:r}=window.DBGATE_TOOLS,a=n(2),{mssqlSplitterOptions:s}=n(3),i={limitSelect:!0,rangeSelect:!0,offsetFetchRangeSyntax:!0,rowNumberOverPaging:!0,stringEscapeChar:"'",fallbackDataType:"nvarchar(max)",explicitDropConstraint:!1,enableConstraintsPerTable:!0,dropColumnDependencies:["default","dependencies","indexes","primaryKey","foreignKeys","uniques"],changeColumnDependencies:["indexes","dependencies","uniques"],anonymousPrimaryKey:!1,dropIndexContainsTableSpec:!0,quoteIdentifier:e=>`[${e}]`,createColumn:!0,dropColumn:!0,changeColumn:!0,createIndex:!0,dropIndex:!0,createForeignKey:!0,dropForeignKey:!0,createPrimaryKey:!0,dropPrimaryKey:!0,createUnique:!0,dropUnique:!0,createCheck:!0,dropCheck:!0,dropReferencesWhenDropTable:!0,columnProperties:{isSparse:!0,isPersisted:!0},predefinedDataTypes:["bigint","bit","decimal(10,2)","int","money","numeric","smallint","smallmoney","tinyint","float","real","date","datetime2","datetime","datetimeofffset","smalldatetime","time","char(20)","varchar(250)","text","nchar(20)","nvarchar(250)","ntext","binary(100)","varbinary(100)","image","xml"]},o={...r,dumperClass:a,dialect:i,readOnlySessions:!1,dialectByVersion:e=>e&&e.productVersionNumber<11?{...i,rangeSelect:!1,offsetFetchRangeSyntax:!1}:i,showConnectionField:(e,t)=>["authType","server","port","user","password","defaultDatabase","singleDatabase","isReadOnly"].includes(e),getQuerySplitterOptions:()=>s,engine:"mssql@dbgate-plugin-mssql",title:"Microsoft SQL Server",defaultPort:1433,defaultAuthTypeName:"tedious",getNewObjectTemplates:()=>[{label:"New view",sql:"CREATE VIEW myview\nAS\nSELECT * FROM table1"},{label:"New procedure",sql:"CREATE PROCEDURE myproc (@arg1 INT)\nAS\nBEGIN\n SELECT * FROM table1\nEND"},{label:"New function",sql:"CREATE FUNCTION myfunc (@arg1 INT) RETURNS INT\nAS\nBEGIN\n RETURN 1;\nEND"},{label:"New table valued function",sql:"CREATE FUNCTION myfunc (@arg1 INT) RETURNS TABLE \nAS\nRETURN SELECT * FROM table1"}]};e.exports=o},function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r);t.default={drivers:[a.a]}},function(e,t){const{SqlDumper:n,testEqualColumns:r,arrayToHexString:a}=window.DBGATE_TOOLS;class s extends n{constructor(e,t){super(e),t&&t.useHardSeparator&&(this.useHardSeparator=!0)}endCommand(){this.useHardSeparator?this.putRaw("\nGO\n"):super.endCommand()}autoIncrement(){this.put(" ^identity")}putStringValue(e){/[^\u0000-\u00ff]/.test(e)&&this.putRaw("N"),super.putStringValue(e)}putByteArrayValue(e){super.putRaw("0x"+a(e))}allowIdentityInsert(e,t){this.putCmd("^set ^identity_insert %f %k",e,t?"on":"off")}transform(e,t){switch(e){case"GROUP:YEAR":case"YEAR":this.put("^datepart(^year, %c)",t);break;case"MONTH":this.put("^datepart(^month, %c)",t);break;case"DAY":this.put("^datepart(^day, %c)",t);break;case"GROUP:MONTH":this.put("^convert(^varchar(100), ^datepart(^year, %c)) + '-' + right('0' + ^convert(^varchar(100), ^datepart(^month, %c)), 2)",t,t);break;case"GROUP:DAY":this.put("^^convert(^varchar(100), ^datepart(^year, %c)) + '-' + ^right('0' + ^convert(^varchar(100), ^datepart(^month, %c)), 2)+'-' + ^right('0' + ^convert(^varchar(100), ^datepart(^day, %c)), 2)",t,t,t);break;default:t()}}renameObject(e,t){this.putCmd("^execute sp_rename '%f', '%s', 'OBJECT'",e,t)}changeObjectSchema(e,t){this.putCmd("^execute sp_changeobjectowner '%f', '%s'",e,t)}dropTable(e,t={}){t.testIfExists&&this.put("IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'%f') AND type in (N'U'))&n",e),super.dropTable(e,t)}dropColumn(e){e.defaultConstraint&&this.putCmd("^alter ^table %f ^drop ^constraint %i",e,e.defaultConstraint),super.dropColumn(e)}dropDefault(e){e.defaultConstraint&&this.putCmd("^alter ^table %f ^drop ^constraint %i",e,e.defaultConstraint)}guessDefaultName(e){return e.defaultConstraint||`DF${e.schemaName||"dbo"}_${e.pureName}_col.columnName`}createDefault(e){if(!e.defaultValue)return;const t=e.defaultValue;if(!t){const n=this.guessDefaultName(e);this.putCmd("^alter ^table %f ^add ^constraint %i ^default %s for %i",e,n,t,e.columnName)}}renameColumn(e,t){this.putCmd("^execute sp_rename '%f.%i', '%s', 'COLUMN'",e,e.columnName,t)}changeColumn(e,t,n){r(e,t,!1,!1)?(this.dropDefault(e),e.columnName!=t.columnName&&this.renameColumn(e,t.columnName),this.createDefault(e)):(this.dropDefault(e),e.columnName!=t.columnName&&this.renameColumn(e,t.columnName),this.put("^alter ^table %f ^alter ^column %i ",e,e.columnName,t.columnName),this.columnDefinition(t,{includeDefault:!1}),this.endCommand(),this.createDefault(e))}specialColumnOptions(e){e.isSparse&&this.put("^sparse ")}renameConstraint(e,t){"index"==e.constraintType?this.putCmd("^execute sp_rename '%f.%i', '%s', 'INDEX'",e,e.constraintName,t):this.putCmd("^execute sp_rename '%f', '%s', 'OBJECT'",{schemaName:e.schemaName,pureName:e.constraintName},t)}}s.prototype.renameView=s.prototype.renameObject,s.prototype.changeViewSchema=s.prototype.changeObjectSchema,s.prototype.renameProcedure=s.prototype.renameObject,s.prototype.changeProcedureSchema=s.prototype.changeObjectSchema,s.prototype.renameFunction=s.prototype.renameObject,s.prototype.changeFunctionSchema=s.prototype.changeObjectSchema,s.prototype.renameTrigger=s.prototype.renameObject,s.prototype.changeTriggerSchema=s.prototype.changeObjectSchema,s.prototype.renameTable=s.prototype.renameObject,s.prototype.changeTableSchema=s.prototype.changeObjectSchema,e.exports=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redisSplitterOptions=t.noSplitSplitterOptions=t.mongoSplitterOptions=t.sqliteSplitterOptions=t.postgreSplitterOptions=t.mssqlSplitterOptions=t.mysqlSplitterOptions=t.defaultSplitterOptions=void 0,t.defaultSplitterOptions={stringsBegins:["'"],stringsEnds:{"'":"'"},stringEscapes:{"'":"'"},allowSemicolon:!0,allowCustomDelimiter:!1,allowGoDelimiter:!1,allowDollarDollarString:!1,noSplit:!1,doubleDashComments:!0,multilineComments:!0,javaScriptComments:!1,returnRichInfo:!1,splitByLines:!1},t.mysqlSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{allowCustomDelimiter:!0,stringsBegins:["'","`"],stringsEnds:{"'":"'","`":"`"},stringEscapes:{"'":"\\","`":"`"}}),t.mssqlSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{allowSemicolon:!1,allowGoDelimiter:!0,stringsBegins:["'","["],stringsEnds:{"'":"'","[":"]"},stringEscapes:{"'":"'"}}),t.postgreSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{allowDollarDollarString:!0,stringsBegins:["'",'"'],stringsEnds:{"'":"'",'"':'"'},stringEscapes:{"'":"'",'"':'"'}}),t.sqliteSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{stringsBegins:["'",'"'],stringsEnds:{"'":"'",'"':'"'},stringEscapes:{"'":"'",'"':'"'}}),t.mongoSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{stringsBegins:["'",'"'],stringsEnds:{"'":"'",'"':'"'},stringEscapes:{"'":"\\",'"':"\\"}}),t.noSplitSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{noSplit:!0}),t.redisSplitterOptions=Object.assign(Object.assign({},t.defaultSplitterOptions),{splitByLines:!0})}]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dbgate-plugin-mssql",
3
3
  "main": "dist/backend.js",
4
- "version": "5.0.0-alpha.1",
4
+ "version": "5.0.0",
5
5
  "homepage": "https://dbgate.org",
6
6
  "description": "MS SQL connect plugin for DbGate",
7
7
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "dbgate-query-splitter": "^4.9.0",
36
36
  "webpack": "^4.42.0",
37
37
  "webpack-cli": "^3.3.11",
38
- "dbgate-tools": "^5.0.0-alpha.1",
38
+ "dbgate-tools": "^5.0.0",
39
39
  "tedious": "^9.2.3",
40
40
  "async-lock": "^1.2.6"
41
41
  }