import{M as o,O as t}from"./index-Cox3ZWL0.js";const a=(r,e)=>{const i={};return r&&(i["X-Trino-Catalog"]=r,e&&(i["X-Trino-Schema"]=e)),i},s=r=>r&&r.includes("/api/")?r.split("/api/")[1]:"",u=o.injectEndpoints({endpoints:r=>({getAdminQueries:r.query({query:()=>({url:"admin/trino/query"}),providesTags:[t.TrinoAdminTag.UIQueries],extraOptions:{skipError:!0}}),getAdminQuery:r.query({query:({queryId:e})=>({url:`admin/trino/query/${e}`}),providesTags:[t.TrinoAdminTag.UIQuery],extraOptions:{skipError:!0}}),getAdminStats:r.query({query:()=>({url:"admin/trino/stats"}),transformResponse:e=>({...e,timestamp:Date.now()}),providesTags:[t.TrinoAdminTag.Stats],extraOptions:{skipError:!0}}),getAdminWorkers:r.query({query:()=>({url:"admin/trino/worker"}),providesTags:[t.TrinoAdminTag.Workers],extraOptions:{skipError:!0}}),getAdminWorker:r.query({query:({workerId:e})=>({url:`admin/trino/worker/${e}/status`}),providesTags:[t.TrinoAdminTag.Worker],extraOptions:{skipError:!0}}),getAdminCluster:r.query({query:()=>({url:"admin/trino/cluster"}),providesTags:[t.TrinoAdminTag.Cluster],extraOptions:{skipError:!0}}),getAdminStatement:r.query({query:e=>({url:s(e)}),extraOptions:{skipError:!0}}),postAdminStatement:r.mutation({query:({sql:e,catalog:i,schema:n})=>({url:"admin/trino/v1/statement",method:"post",headers:a(i,n),data:e})}),deleteAdminStatement:r.mutation({query:e=>({url:s(e),method:"delete"})})})}),{useGetAdminQueriesQuery:d,useGetAdminQueryQuery:p,useGetAdminStatsQuery:y,useGetAdminWorkersQuery:A,useGetAdminWorkerQuery:g,useGetAdminClusterQuery:T}=u;export{A as a,T as b,y as c,p as d,g as e,d as u};
