IRPCObjectTypesAdmin.ParseSQLSelectStatement
Administration API / specialized admin session idempotent
Connects to an external database and returns the source table and columns of a SELECT statement, to set up the column mappings of an external object type.
| Service | Object type administration MFiles.IRPCObjectTypesAdmin |
|---|---|
| gRPC method | /MFiles.IRPCObjectTypesAdmin/ParseSQLSelectStatement |
| HTTP (mf-http-grpc) | POST /grpc/v1/parse-sqlselect-statement |
| Request | ParseSQLSelectStatementRequest |
| Response | ParseSQLSelectStatementResponse |
| Book and level | Administration API, specialized |
| Kind | admin |
| Session | Required: the session ID from LogIn in the mfiles-session-id-bin metadata. |
| Idempotent | yes |
| Returns metadata structure version | no |
| Streaming | none (unary) |
Remarks
- Requires
change_metadata_structureandlicense_allows_modifications. The server opens the connection itself, so the call also requires the server rightrun_code(system administrator), unless the connection string matches the providers and settings that the server allows for vault administrators. - An empty
connection_string(the vault's own database) is always refused with "Access denied.". - Read-only: nothing is saved. Apply the result with ModifyObjectType.
Request: ParseSQLSelectStatementRequest
Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.
| Field | Type | Description |
|---|---|---|
connection_string | string | OLE DB connection string of the external database. |
select_statement | string | The SELECT statement to parse. |
Response: ParseSQLSelectStatementResponse
Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.
| Field | Type | Description |
|---|---|---|
source_table | string | The name of the source table. |
putf8szcolmappings[] | repeated ObjectTypeColumnMapping | One mapping per column in the SELECT list, with only the source column details set; fill in the target property definitions yourself. |
putf8szcolmappings[].object_type | int32 | Object type ID. |
putf8szcolmappings[].ordinal | int32 | One-based source field ordinal. |
putf8szcolmappings[].source_field | string | Source field name. |
putf8szcolmappings[].data_type | uint32 | Source field's data type. |
putf8szcolmappings[].target_property_def | int32 | Target property definition. |
putf8szcolmappings[].can_insert | bool | Is the source field part of insertion operations? |
putf8szcolmappings[].can_update | bool | Is the source field part of update operations? |
Related methods
- ModifyObjectType -- Saves a changed definition of an object type or value list.