1import{c as t}from"./converters.51ef0e62.js";import{n as e}from"./vueComponentNormalizer.fc2fb13f.js";import"./lazy-loaders.0bffce22.js";import"./sweetalert2.8872205b.js";import"./download-feedback.53c63ecb.js";var a=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"tool-container"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:"csv-input"}},[t._v("CSV Input")]),t._v(" "),a("textarea",{directives:[{name:"model",rawName:"v-model",value:t.csvInput,expression:"csvInput"}],staticClass:"form-control",attrs:{id:"csv-input",rows:"12",placeholder:"name,age Alice,30 Bob,28"},domProps:{value:t.csvInput},on:{input:function(e){e.target.composing||(t.csvInput=e.target.value)}}})]),t._v(" "),a("div",{staticClass:"form-row"},[a("div",{staticClass:"form-group col-md-6"},[a("label",{attrs:{for:"table-name"}},[t._v("Table Name")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.tableName,expression:"tableName"}],staticClass:"form-control",attrs:{id:"table-name",type:"text",placeholder:"my_table"},domProps:{value:t.tableName},on:{input:function(e){e.target.composing||(t.tableName=e.target.value)}}})]),t._v(" "),a("div",{staticClass:"form-group col-md-6"},[a("label",{attrs:{for:"delimiter"}},[t._v("Delimiter")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.delimiter,expression:"delimiter"}],staticClass:"form-control",attrs:{id:"delimiter",type:"text",maxlength:"1"},domProps:{value:t.delimiter},on:{input:function(e){e.target.composing||(t.delimiter=e.target.value)}}})])]),t._v(" "),a("button",{staticClass:"btn btn-primary",on:{click:t.convert}},[a("i",{staticClass:"fa fa-table",attrs:{"aria-hidden":"true"}}),t._v(" CSV â SQL\n ")]),t._v(" "),t.sqlOutput?a("div",{staticClass:"mt-3"},[a("label",{attrs:{for:"sql-output"}},[t._v("Generated SQL")]),t._v(" "),a("textarea",{directives:[{name:"model",rawName:"v-model",value:t.sqlOutput,expression:"sqlOutput"}],staticClass:"form-control",attrs:{id:"sql-output",rows:"10",readonly:""},domProps:{value:t.sqlOutput},on:{focus:function(e){return t.select(e)}
1,input:function(e){e.target.composing||(t.sqlOutput=e.target.value)}}}),t._v(" "),a("div",{staticClass:"mt-2"},[a("button",{staticClass:"btn btn-primary mr-2",on:{click:t.copy}},[a("i",{staticClass:"fa fa-copy",attrs:{"aria-hidden":"true"}}),t._v(" Copy")]),t._v(" "),a("button",{staticClass:"btn btn-secondary",on:{click:t.download}},[a("i",{staticClass:"fa fa-download",attrs:{"aria-hidden":"true"}}),t._v(" Download")])])]):t._e(),t._v(" "),t.error?a("div",{staticClass:"alert alert-danger mt-3"},[t._v(t._s(t.error))]):t._e()])},s=[];const o={};var r=e({name:"CsvToSqlConverter",data:()=>({csvInput:"name,age\nAlice,30\nBob,28",tableName:"my_table",delimiter:",",sqlOutput:"",error:""}),methods:{select(t){t.target.select()},convert(){this.error="",this.sqlOutput="";try{const e=t(this.csvInput,this.tableName||"my_table",this.delimiter||",");this.sqlOutput=e.sql}catch(e){this.error=e.message||"Failed to convert CSV to SQL."}},copy(){this.sqlOutput&&(APP.TOOLS.copy(this.sqlOutput),$.toast({title:"Copied",message:"SQL copied to clipboard.",style:"success"}))},download(){this.sqlOutput&&this.downloadFile(this.sqlOutput,"converted.sql","application/sql")},downloadFile(t,e,a){try{const s=new Blob([t],{type:`${a};charset=utf-8`}),o=URL.createObjectURL(s),r=document.createElement("a");r.href=o,r.download=e,r.click(),URL.revokeObjectURL(o)}catch(s){this.error="Unable to download file: "+s.message}}}},a,s,!1,l,"4d93b10d",null,null);function l(t){for(let e in o)this[e]=o[e]}const i=function(){return r.exports}();export{i as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.