- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 263
Implementation of external data management #1158 #8759
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
base: master
Are you sure you want to change the base?
Conversation
| This is a draft implementation of external data management (SQL:MED). It will be improved after the metacache #7954 is merged. | 
| Are there any restrictions for users/roles on using foreign servers? I think there should be. That is, we should have something like: This is important, especially if the foreign server stores authentication data. Not every authenticated user should be able to use it in an  | 
        
          
                doc/sql.extensions/README.MED.md
              
                Outdated
          
        
      | | RDB$FOREIGN_SERVER_NAME | CHAR \(63\) | The foreign server name | | ||
| | RDB$FOREIGN_OPTION_NAME | CHAR \(63\) | Option name | | ||
| | RDB$FOREIGN_OPTION_VALUE | VARCHAR \(32765\) | Option value | | ||
| | RDB$OWNER_NAME | SHORT | Option type | | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be RDB$FOREIGN_OPTION_TYPE ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, corrected.
| continue; | ||
|  | ||
| buffer.append(option.first.c_str()); | ||
| buffer.append(";"); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there a semicolon ; here? I would have expected an equals symbol =.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was that option names and option values follow each other and there is no sense in adding a special character to separate them, i.e. option_1_name;option_1_value;option_2_name;option_2_value;.... If this is confusing, it can be changed to something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle, this approach will work, provided that each option requires a value. In this case, we eliminate the possibility of passing only the option name as a flag.
GRANT USAGE ON FOREIGN SERVER <server_name>
TO <grantee_list> [WITH GRANT OPTION]
[{GRANTED BY | AS} [USER] <grantor>];
REVOKE [GRANT OPTION FOR]
USAGE ON FOREIGN SERVER <server_name>
FROM <grantee_list>
[{GRANTED BY | AS} [USER] <grantor>];
    | 
 Yes, there should be restrictions on using foreign servers. The MED standard requires  | 
| [[DROP] FOREIGN DATA WRAPPER | [DROP] USING PLUGIN <provider(plugin)>] [OPTIONS(<option> [, <option> ...] )] | ||
| <option> ::= { | ||
| [DROP] <option name> [= 'value'] | ||
| | [DROP] <option name> [{FILE | ENV}] ['value'] } | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description confuses people because it's unclear what's required and what's optional. A better explanation would be:
ALTER SERVER <foreign server name>
        [[DROP] {FOREIGN DATA WRAPPER | USING PLUGIN} <provider(plugin)>] 
        [OPTIONS (<option> [, <option> ...] )]
<option> ::= {
          <option name> = 'value'
        | <option name> [{FILE | ENV}] 'value' 
        | DROP <option name>
}
| 
 This should be described in the  | 
Link to RFC - Distributed queries (Management of External Data) proposal