CurtHagenlocher commented on issue #630:
URL: https://github.com/apache/arrow-adbc/issues/630#issuecomment-4692049475

   Okay, here's my stab at an API for this:
   ```
   #define ADBC_OPTION_LEVEL_ALL 0
   #define ADBC_OPTION_LEVEL_DATABASE 1
   #define ADBC_OPTION_LEVEL_CONNECTION 2
   #define ADBC_OPTION_LEVEL_STATEMENT 3
   
   #define ADBC_OPTION_TYPE_STRING 1
   #define ADBC_OPTION_TYPE_BYTES 2
   #define ADBC_OPTION_TYPE_DOUBLE 3
   #define ADBC_OPTION_TYPE_INT 4
   
   /// \brief Get a list of the options supported by the driver
   ///
   /// The result is an Arrow dataset with the following schema:
   ///
   /// | Field Name               | Field Type              |
   /// |--------------------------|-------------------------|
   /// | option_name              | utf8 not null           |
   /// | option_level             | int8 not null           |
   /// | option_type              | int8 not null           |
   /// | option_values            | list<utf8>              |
   /// | required                 | bool not null           |
   /// | can_set_before           | bool not null           |
   /// | can_set_after            | bool not null           |
   /// | option_documentation     | utf8                    |
   ///
   /// \param[in] level Which ADBC type the option applies to.
   /// \param[out] out The result set.
   /// \param[out] error Error details, if an error occurs.
   ADBC_EXPORT
   AdbcStatusCode (*GetOptionsList)(const uint32_t level, struct 
ArrowArrayStream* out, struct AdbcError* error);
   ```
   Obviously this would preclude returning options specific to a particular 
connection, so that if the FOO option was only valid if you were connecting to 
a database version 10 or later, there would be no way to discover this 
programmatically. I think that's a reasonable tradeoff between expressiveness 
and implementation burden but it's not one I feel super strongly about.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to