sqliteQuery: Fetch the result of a specific query from an SQLite database

Description Usage Arguments Value Author(s) Examples

View source: R/rsqlite.R

Description

Fetch the result of a specific query from an SQLite database

Usage

1
sqliteQuery(query, file)

Arguments

query

The SQL query to submit

file

Path to the SQLite database file

Value

The result of the query as a data.frame.

Author(s)

Kevin Rue-Albrecht and Stephen Sansom

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Setup ----

library(RSQLite)

database_file <- tempfile()
conn <- dbConnect(SQLite(), dbname = database_file)
dbWriteTable(conn, "mtcars", mtcars[1:5, ])
dbDisconnect(conn)

# Example ----

sqliteQuery("select * from mtcars", database_file)

kevinrue/sqlighter documentation built on Nov. 16, 2020, 5:59 p.m.