Skip to content

Commit 59175c8

Browse files
committed
docs: Use con in examples
1 parent 174207c commit 59175c8

File tree

7 files changed

+34
-34
lines changed

7 files changed

+34
-34
lines changed

pkg-r/R/DBISource.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
#' @examples
1010
#' \dontrun{
1111
#' # Connect to a database
12-
#' conn <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
13-
#' DBI::dbWriteTable(conn, "mtcars", mtcars)
12+
#' con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
13+
#' DBI::dbWriteTable(con, "mtcars", mtcars)
1414
#'
1515
#' # Create a DBI source
16-
#' db_source <- DBISource$new(conn, "mtcars")
16+
#' db_source <- DBISource$new(con, "mtcars")
1717
#'
1818
#' # Get database type
1919
#' db_source$get_db_type() # Returns "SQLite"
@@ -40,9 +40,9 @@ DBISource <- R6::R6Class(
4040
#' @return A new DBISource object
4141
#' @examples
4242
#' \dontrun{
43-
#' conn <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
44-
#' DBI::dbWriteTable(conn, "iris", iris)
45-
#' source <- DBISource$new(conn, "iris")
43+
#' con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
44+
#' DBI::dbWriteTable(con, "iris", iris)
45+
#' source <- DBISource$new(con, "iris")
4646
#' }
4747
initialize = function(conn, table_name) {
4848
if (!inherits(conn, "DBIConnection")) {

pkg-r/R/QueryChat.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ QueryChat <- R6::R6Class(
142142
#'
143143
#' # With database
144144
#' library(DBI)
145-
#' conn <- dbConnect(RSQLite::SQLite(), ":memory:")
146-
#' dbWriteTable(conn, "mtcars", mtcars)
147-
#' qc <- QueryChat$new(conn, "mtcars")
145+
#' con <- dbConnect(RSQLite::SQLite(), ":memory:")
146+
#' dbWriteTable(con, "mtcars", mtcars)
147+
#' qc <- QueryChat$new(con, "mtcars")
148148
#' }
149149
initialize = function(
150150
data_source,
@@ -748,9 +748,9 @@ QueryChat <- R6::R6Class(
748748
#'
749749
#' # Chat with a database table (table_name required)
750750
#' library(DBI)
751-
#' conn <- dbConnect(RSQLite::SQLite(), ":memory:")
752-
#' dbWriteTable(conn, "mtcars", mtcars)
753-
#' querychat_app(conn, "mtcars")
751+
#' con <- dbConnect(RSQLite::SQLite(), ":memory:")
752+
#' dbWriteTable(con, "mtcars", mtcars)
753+
#' querychat_app(con, "mtcars")
754754
#'
755755
#' # Create QueryChat class object
756756
#' qc <- querychat(mtcars)

pkg-r/R/TblSqlSource.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ TblSqlSource <- R6::R6Class(
4545
#' string, or will be inferred from the `tbl` argument, if possible.
4646
#' @return A new TblSqlSource object
4747
#' @examplesIf rlang::is_interactive() && rlang::is_installed("dbplyr") && rlang::is_installed("dplyr") && rlang::is_installed("RSQLite")
48-
#' conn <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
49-
#' DBI::dbWriteTable(conn, "mtcars", mtcars)
48+
#' con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
49+
#' DBI::dbWriteTable(con, "mtcars", mtcars)
5050
#' source <- TblSqlSource$new(dplyr::tbl(con, "mtcars"))
5151
initialize = function(tbl, table_name = missing_arg()) {
5252
check_installed("dbplyr")

pkg-r/man/DBISource.Rd

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg-r/man/QueryChat.Rd

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg-r/man/TblSqlSource.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg-r/man/querychat-convenience.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)