Skip to content

[051-movie-explorer] update from src_sqlite to tbl #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jhk0530 opened this issue May 25, 2025 · 0 comments
Open

[051-movie-explorer] update from src_sqlite to tbl #223

jhk0530 opened this issue May 25, 2025 · 0 comments

Comments

@jhk0530
Copy link
Contributor

jhk0530 commented May 25, 2025

Hello team, In movie explorer's code

# Set up handles to database tables on app start
db <- src_sqlite("movies.db")
omdb <- tbl(db, "omdb")
tomatoes <- tbl(db, "tomatoes")

The src_sqlite() function was deprecated in {dplyr} 1.0.0, (latest version is 1.1.4)
and it guides to use tbl() function instead as warning message below.

Warning: `src_sqlite()` was deprecated in dplyr 1.0.0.
ℹ Please use `tbl()` directly with a database connection
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.

So how about using DBI::dbConnect and RQLite::SQLite() that suggested in src_sqlite() document?

Example docs

con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
copy_to(con, mtcars)

Final result

# Set up handles to database tables on app start
con <- DBI::dbConnect(RSQLite::SQLite(), "movies.db")
omdb <- dplyr::tbl(con, "omdb")
tomatoes <- dplyr::tbl(con, "tomatoes")

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant