feat: add back the InfluxQL REPL (#386)
* add v1-compatible query path and refactor other paths to de-duplicate "/query" * add initial influxQL repl * add ping endpoint to schema * improve prompt UX, implement some commands * fix json column type in schema and improve completion * feat: add table formatter and move to forked go-prompt * improve formatting and add table pagination * implement more REPL commands, including insert and history * implement "INSERT INTO" * move repl command to "v1 repl" * refactor and improve documentation * clean up v1_repl cmd * update to latest openapi, use some openapi paths instead of overrides * remove additional files that were moved to openapi * compute historyFilePath at REPL start * clean up REPL use command logic flow * clean up comments for TODOs now in issues * move gopher (chonky boi) * remove autocompletion for separate PR * run go mod tidy * add rfc3339 precision option * allow left and right column scrolling to display whole table * add error to JSON query response * add tags and partial to JSON response series schema * fix csv formatting and add column formatting * remove table format for separate PR * fix getDatabases * move from write to legacy write endpoint for INSERT * remove history vestiges * allow multiple spaces in INSERT commands * add precision comment * remove auth for separate PR * separate parseInsert and add unit test * add additional test case and improve error messages * fix missing errors import * print rfc3339 precision * add rfc3339 to help output
This commit is contained in:
@ -49,7 +49,7 @@ type TasksApi interface {
|
||||
DeleteTasksIDExecuteWithHttpInfo(r ApiDeleteTasksIDRequest) (*_nethttp.Response, error)
|
||||
|
||||
/*
|
||||
* DeleteTasksIDRunsID Cancel a running task
|
||||
* DeleteTasksIDRunsID Cancel a running task. #### InfluxDB Cloud - Doesn't support this operation.
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param taskID The task ID.
|
||||
* @param runID The run ID.
|
||||
@ -157,7 +157,7 @@ type TasksApi interface {
|
||||
GetTasksIDRunsExecuteWithHttpInfo(r ApiGetTasksIDRunsRequest) (Runs, *_nethttp.Response, error)
|
||||
|
||||
/*
|
||||
* GetTasksIDRunsID Retrieve a single run for a task
|
||||
* GetTasksIDRunsID Retrieve a single run for a task.
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param taskID The task ID.
|
||||
* @param runID The run ID.
|
||||
@ -368,7 +368,7 @@ func (a *TasksApiService) DeleteTasksIDExecuteWithHttpInfo(r ApiDeleteTasksIDReq
|
||||
return nil, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/tasks/{taskID}"
|
||||
localVarPath := localBasePath + "/api/v2/tasks/{taskID}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", _neturl.PathEscape(parameterToString(r.taskID, "")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
@ -479,7 +479,7 @@ func (r ApiDeleteTasksIDRunsIDRequest) ExecuteWithHttpInfo() (*_nethttp.Response
|
||||
}
|
||||
|
||||
/*
|
||||
* DeleteTasksIDRunsID Cancel a running task
|
||||
* DeleteTasksIDRunsID Cancel a running task. #### InfluxDB Cloud - Doesn't support this operation.
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param taskID The task ID.
|
||||
* @param runID The run ID.
|
||||
@ -521,7 +521,7 @@ func (a *TasksApiService) DeleteTasksIDRunsIDExecuteWithHttpInfo(r ApiDeleteTask
|
||||
return nil, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/tasks/{taskID}/runs/{runID}"
|
||||
localVarPath := localBasePath + "/api/v2/tasks/{taskID}/runs/{runID}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", _neturl.PathEscape(parameterToString(r.taskID, "")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"runID"+"}", _neturl.PathEscape(parameterToString(r.runID, "")), -1)
|
||||
|
||||
@ -578,6 +578,17 @@ func (a *TasksApiService) DeleteTasksIDRunsIDExecuteWithHttpInfo(r ApiDeleteTask
|
||||
}
|
||||
newErr.body = localVarBody
|
||||
newErr.error = localVarHTTPResponse.Status
|
||||
if localVarHTTPResponse.StatusCode == 405 {
|
||||
var v Error
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
|
||||
newErr.model = &v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
var v Error
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
@ -728,7 +739,7 @@ func (a *TasksApiService) GetTasksExecuteWithHttpInfo(r ApiGetTasksRequest) (Tas
|
||||
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/tasks"
|
||||
localVarPath := localBasePath + "/api/v2/tasks"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
@ -915,7 +926,7 @@ func (a *TasksApiService) GetTasksIDExecuteWithHttpInfo(r ApiGetTasksIDRequest)
|
||||
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/tasks/{taskID}"
|
||||
localVarPath := localBasePath + "/api/v2/tasks/{taskID}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", _neturl.PathEscape(parameterToString(r.taskID, "")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
@ -1079,7 +1090,7 @@ func (a *TasksApiService) GetTasksIDLogsExecuteWithHttpInfo(r ApiGetTasksIDLogsR
|
||||
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/tasks/{taskID}/logs"
|
||||
localVarPath := localBasePath + "/api/v2/tasks/{taskID}/logs"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", _neturl.PathEscape(parameterToString(r.taskID, "")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
@ -1279,7 +1290,7 @@ func (a *TasksApiService) GetTasksIDRunsExecuteWithHttpInfo(r ApiGetTasksIDRunsR
|
||||
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/tasks/{taskID}/runs"
|
||||
localVarPath := localBasePath + "/api/v2/tasks/{taskID}/runs"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", _neturl.PathEscape(parameterToString(r.taskID, "")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
@ -1421,7 +1432,7 @@ func (r ApiGetTasksIDRunsIDRequest) ExecuteWithHttpInfo() (Run, *_nethttp.Respon
|
||||
}
|
||||
|
||||
/*
|
||||
* GetTasksIDRunsID Retrieve a single run for a task
|
||||
* GetTasksIDRunsID Retrieve a single run for a task.
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param taskID The task ID.
|
||||
* @param runID The run ID.
|
||||
@ -1466,7 +1477,7 @@ func (a *TasksApiService) GetTasksIDRunsIDExecuteWithHttpInfo(r ApiGetTasksIDRun
|
||||
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/tasks/{taskID}/runs/{runID}"
|
||||
localVarPath := localBasePath + "/api/v2/tasks/{taskID}/runs/{runID}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", _neturl.PathEscape(parameterToString(r.taskID, "")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"runID"+"}", _neturl.PathEscape(parameterToString(r.runID, "")), -1)
|
||||
|
||||
@ -1642,7 +1653,7 @@ func (a *TasksApiService) GetTasksIDRunsIDLogsExecuteWithHttpInfo(r ApiGetTasksI
|
||||
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/tasks/{taskID}/runs/{runID}/logs"
|
||||
localVarPath := localBasePath + "/api/v2/tasks/{taskID}/runs/{runID}/logs"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", _neturl.PathEscape(parameterToString(r.taskID, "")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"runID"+"}", _neturl.PathEscape(parameterToString(r.runID, "")), -1)
|
||||
|
||||
@ -1817,7 +1828,7 @@ func (a *TasksApiService) PatchTasksIDExecuteWithHttpInfo(r ApiPatchTasksIDReque
|
||||
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/tasks/{taskID}"
|
||||
localVarPath := localBasePath + "/api/v2/tasks/{taskID}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", _neturl.PathEscape(parameterToString(r.taskID, "")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
@ -1984,7 +1995,7 @@ func (a *TasksApiService) PostTasksExecuteWithHttpInfo(r ApiPostTasksRequest) (T
|
||||
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/tasks"
|
||||
localVarPath := localBasePath + "/api/v2/tasks"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
@ -2161,7 +2172,7 @@ func (a *TasksApiService) PostTasksIDRunsExecuteWithHttpInfo(r ApiPostTasksIDRun
|
||||
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/tasks/{taskID}/runs"
|
||||
localVarPath := localBasePath + "/api/v2/tasks/{taskID}/runs"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", _neturl.PathEscape(parameterToString(r.taskID, "")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
@ -2347,7 +2358,7 @@ func (a *TasksApiService) PostTasksIDRunsIDRetryExecuteWithHttpInfo(r ApiPostTas
|
||||
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/tasks/{taskID}/runs/{runID}/retry"
|
||||
localVarPath := localBasePath + "/api/v2/tasks/{taskID}/runs/{runID}/retry"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", _neturl.PathEscape(parameterToString(r.taskID, "")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"runID"+"}", _neturl.PathEscape(parameterToString(r.runID, "")), -1)
|
||||
|
||||
|
Reference in New Issue
Block a user