db.dumpJSON: Dump the contents of a table or database into a JSON array

View source: R/db-json.R

db.dumpJSONR Documentation

Dump the contents of a table or database into a JSON array

Description

Dump the contents of a table or database into a JSON array

Usage

db.dumpJSON(db, table, file = NULL)

Arguments

db

The database connection.

table

The table name.

file

A file to dump the contents to. If NULL the dump is returned as a character string.

Details

If table is missing the entire database is dumped into an array of JSON objects. Each object has two fields: a "table" field with the name of the table and a "data" field with the table data. The "data" is an array of JSON objects. Each object represents one row of table data and the JSON object holds a field for each table column. If table is not missing then only the contents of that table are dumped and the return value consists only of the "data" array.

Note

This does require that SQLite was compiled with the option -DSQLITE_ENABLE_JSON1.


blueraleigh/db documentation built on Feb. 25, 2024, 9:13 a.m.