write_qst {qst}R Documentation

Write a data.frame to an SQLite database

Description

This function writes a data.frame to an SQLite database. The database has one table, named data, containing the data. Additional tables, prefixed with meta_, may be added in the future to support additional data types not supported in a native way by SQLite.

Usage

write_qst(x, path, ..., unique_indexes = NULL, indexes = NULL)

Arguments

x

A data.frame to be written to file. Supported column types are integer, numeric and character.

path

The path to write to.

...

Other parameters passed to methods.

unique_indexes

A list of character vectors. Each element of the list will create a new unique index over the specified column(s). Duplicate rows will result in failure.

indexes

A list of character vectors. Each element of the list will create a new index.

Value

The original data frame passed in x

Examples

# Write the cars data set to a file
cars_db <- tempfile()
write_qst(cars, cars_db, indexes=list("speed"))
unlink(cars_db)


[Package qst version 0.1.2 Index]