CurtHagenlocher commented on code in PR #2169:
URL: https://github.com/apache/arrow-adbc/pull/2169#discussion_r1767100605


##########
go/adbc/driver/snowflake/connection.go:
##########
@@ -239,13 +261,13 @@ func (c *connectionImpl) GetCurrentDbSchema() (string, 
error) {
 
 // SetCurrentCatalog implements driverbase.CurrentNamespacer.
 func (c *connectionImpl) SetCurrentCatalog(value string) error {
-       _, err := c.cn.ExecContext(context.Background(), "USE DATABASE ?", 
[]driver.NamedValue{{Value: value}})
+       _, err := c.cn.ExecContext(context.Background(), fmt.Sprintf("USE 
DATABASE %s", value), nil)

Review Comment:
   Bobby Tables says never to forget about quoting SQL identifiers properly. 
Snowflake identifiers can contain spaces and double-quotes and semicolons, and 
are quoted by using delimiting with double-quotes and doubling any contained 
double-quotes. That is, `A` -> `"A"`, `A B` -> `"A B", `A B / C" ; D` -> `"A B 
/ C"" ; D"`. (This is pretty consistent with most SQL dialects.



##########
csharp/src/Apache.Arrow.Adbc/AdbcConnection.cs:
##########
@@ -31,6 +31,11 @@ public abstract class AdbcConnection : IDisposable
         private bool _readOnly = false;
         private IsolationLevel _isolationLevel = IsolationLevel.Default;
 
+        public static string CurrentCatalogOption = "adbc.connection.catalog";
+        public static string CurrentDbSchemaOption = 
"adbc.connection.db_schema";
+        public static string ReadOnlyOption = "adbc.connection.readonly";
+        public static string AutoCommitOption = "adbc.connection.autocommit";
+

Review Comment:
   These are currently in the AdbcOptions class e.g. 
`AdbcOptions.Connection.CurrentCatalog`. Are you thinking that that class 
should be deprecated in favor of distributing them into the 
connection/statement/etc. classes? I seem to recall that there were some 
cross-cutting concerns that made it desirable to keep them under AdbcOptions.



-- 
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