% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/reader.R
\name{snowflake_reader}
\alias{snowflake_reader}
\title{Create a Snowflake reader}
\usage{
snowflake_reader(
  account = NULL,
  warehouse = NULL,
  database = NULL,
  schema = NULL,
  role = NULL,
  user = NULL,
  password = NULL,
  authenticator = NULL,
  connection_name = NULL,
  driver = NULL,
  ...,
  connection_string = NULL
)
}
\arguments{
\item{account}{Snowflake account identifier (e.g. \code{"xy12345"} or
\code{"xy12345.us-east-1"}). Translated to
\verb{Server=\{account\}.snowflakecomputing.com} in the connection string.}

\item{warehouse, database, schema, role}{Snowflake session defaults.}

\item{user, password}{User credentials. Prefer a DSN, \code{connection_name}, or
\code{authenticator = "externalbrowser"} over hard-coded passwords.}

\item{authenticator}{Snowflake authenticator (e.g. \code{"externalbrowser"},
\code{"snowflake_jwt"}, \code{"oauth"}).}

\item{connection_name}{Named entry in \verb{~/.snowflake/connections.toml} whose
fields will fill in the remaining connection parameters.}

\item{driver}{Override the ODBC driver name (defaults to \code{"Snowflake"}).}

\item{...}{Additional named \code{key = value} parameters appended to the
connection string.}

\item{connection_string}{A full raw connection string, bypassing the named
arguments. \code{Driver={Snowflake};} is prepended if it isn't already present.}
}
\value{
A \code{Reader} object.
}
\description{
Convenience constructor for Snowflake connections. Uses the ODBC reader
under the hood with the \code{Snowflake} driver, and takes advantage of the
dedicated Snowflake handling in the ggsql Rust core:
}
\details{
Special handling of Snowflake includes:
\itemize{
\item If \code{connection_name} is supplied (or \verb{ConnectionName=} appears in the
connection string), it is resolved against \verb{~/.snowflake/connections.toml}.
\item When running inside Posit Workbench, an OAuth token is automatically
injected if one is available.
\item Schema introspection uses Snowflake's \verb{SHOW DATABASES / SCHEMAS / TABLES}
commands rather than \code{information_schema}.
}

Requires the Snowflake ODBC driver to be installed on the system.
}
\examples{
\dontrun{
# Using a named connection from ~/.snowflake/connections.toml
reader <- snowflake_reader(connection_name = "my_workbench")

# Browser-based SSO
reader <- snowflake_reader(
  account = "xy12345.us-east-1",
  user = "alice@example.com",
  authenticator = "externalbrowser",
  warehouse = "COMPUTE_WH",
  database = "ANALYTICS",
  schema = "PUBLIC",
  role = "ANALYST"
)
}

}
\seealso{
Other readers: 
\code{\link{custom_reader}()},
\code{\link{duckdb_reader}()},
\code{\link{odbc_reader}()}
}
\concept{readers}
