rsqlitedbirsqlite

What does ":memory:" mean in the DBI::dbConnect() function?


I am learning how to use the DBI package in R and came across this sample code from the documentation

con <- DBI::dbConnect(RSQLite::SQLite(), dbname = ":memory:")

What does ":memory:" mean here? I understand that dbname = defines the name of the database, but I've never seen the format ":string:" in R before.


Solution

  • From the documentation:

    ":memory:" is a special path that creates an in-memory database.

    If you run ?DBI::dbConnect() and scroll down to the examples, you'll see this explanation as a comment for the first example code.