(window.webpackJsonp=window.webpackJsonp||[]).push([[218],{181:function(e,t){angular.module("graphdb.framework.rest.jdbc.service",[]).factory("JdbcRestService",n),n.$inject=["$http","$repositories","$translate"];function n(e,t){return{getJdbcConfigurations:function(){return e.get("rest/sql-views/tables")},getJdbcConfiguration:function(t){return e.get("rest/sql-views/tables/"+t)},createNewJdbcConfiguration:function(e){return n("POST","",e)},updateJdbcConfiguration:function(e){return n("PUT",e.name,e)},deleteJdbcConfiguration:function(t){return e.delete("rest/sql-views/tables/"+t)},getColumnNames:function(t){return e.post("rest/sql-views/columns",t,{headers:{Accept:"application/json","Content-Type":"text/plain"}})},getColumnsTypeSuggestion:function(n,r){if(!Array.isArray(r))throw new Error(t.instant("jdbc.column.names.constraint"));return e({method:"POST",url:"rest/sql-views/types",data:{query:n,column_names:r}})},getExistingSqlTablePreview:function(t,n){return e({method:"GET",url:"rest/sql-views/preview/"+t,params:{limit:n}})},getNewSqlTablePreview:function(t,n){return e({method:"POST",url:"rest/sql-views/preview",contentType:"application/json; charset=utf-8",dataType:"json",data:t,params:{limit:n},headers:{Accept:"application/sparql-results+json"}})}};function n(t,n,r){return e({method:t,url:"rest/sql-views/tables/"+n,noCancelOnRouteChange:!0,data:{name:r.name,query:r.query,columns:r.columns||[]}})}}}}]);