Alter handles requests to change the schema or remove parts or all of the data.
(ctx context.Context, req *api.RunDQLRequest)
| 16 | |
| 17 | // Alter handles requests to change the schema or remove parts or all of the data. |
| 18 | func (s *Server) RunDQL(ctx context.Context, req *api.RunDQLRequest) (*api.Response, error) { |
| 19 | apiReq, err := dql.ParseDQL(req.DqlQuery) |
| 20 | if err != nil { |
| 21 | return nil, fmt.Errorf("error parsing DQL query: %w", err) |
| 22 | } |
| 23 | |
| 24 | apiReq.Vars = req.Vars |
| 25 | apiReq.ReadOnly = req.ReadOnly |
| 26 | apiReq.BestEffort = req.BestEffort |
| 27 | apiReq.RespFormat = req.RespFormat |
| 28 | if len(apiReq.Mutations) > 0 { |
| 29 | apiReq.CommitNow = true |
| 30 | } |
| 31 | |
| 32 | ctx = x.AttachJWTNamespace(ctx) |
| 33 | return (&Server{}).doQuery(ctx, &Request{req: apiReq}) |
| 34 | } |