-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The internalstorage allows passing a piece of SQL to support more flexible query requirements #151
Comments
Whether base64 SQL can be used as the value of the label ? Since this feature is not likely to be used in |
This idea is very good, and a more flexible query method is urgently needed in our actual product use |
We also need to introduce our table structure to users, so they can build the correct SQL statements. |
@calvin0327 Yes, this is provided as an advanced feature, and it is provided by internalstorage; other storage layers do not provide this feature. |
After some research, it turns out that base64 doesn't work well because the character length reaches the label selector limit. Then this function may only pass sql via query, and does not support search labels. @calvin0327 Then, to make it easier to use, we may need to implement a client that supports setting url queries in client-go |
@Iceber it should be implemented in client-go. but I still don't know how to implement |
Roughly similar to the dynamic client, we can additionally support adding a URL Params parameter to the List function. func (c *NewClient) List(ctx context.Context, opts metav1.ListOptions, params map[string]string, obj runtime.Object) error {
request := c.client.client.Get().AbsPath(c.url).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1)
for key, value := range params {
request.Param(key, value)
}
return request.Do(ctx).Into(obj)
} |
What would you like to be added?
Many complex search queries are currently available, such as field selector and search by owner, but sometimes users have more customizable query needs .
To make the query more powerful, the plan wants to add an exclusive query feature to internalstorage that supports users passing a piece of SQL and then splicing the user's SQL after the WHERE.
Of course, in order to be compatible with the generic Search Label, which is still available, the SQL will be spliced after the sql according to the Search Label, but before the ORDER BY.
There are two current questions that need to be resolved
Also the different syntax between postgres and mysql may need to be handled by the user depending on the storage component they choose .
The clusterpedia does not handle the compatibility of SQL pieces in different storage components.
The text was updated successfully, but these errors were encountered: