The schema is added as attribute to the connection object and is automatically used by dbInsert, dbGet, and dbUpdate.

dbConnectSQLiteWithSchema(
  dbname,
  schema.file = paste0(tools::file_path_sans_ext(dbname), ".yaml"),
  schema = load.and.init.schemas(schema.file)
)

Arguments

dbname

Filename of the SQLite database

schema.file

YAML file that contains the database schema. By default it is assumed to be in the same folder as the database with the same name but the extension ".yaml"

schema

If you already loaded a schema file manually with load.and.init.schemas, you can also provide it here instead of specifying a schema.file.