create_gsheet_db: Create new 'googlesheet' reglog database

View source: R/deprecated_database.R

create_gsheet_dbR Documentation

Create new 'googlesheet' reglog database

Description

[Deprecated]

Used to match deprecated 'login_server' function. Use gsheet_tables_create() to create 'googlesheet'-based database for new 'RegLogServer' object.

Usage

create_gsheet_db(name = NULL, credentials = NULL, credentials_pass_hashed)

Arguments

name

specify name for 'googlesheet' file. Defaults to random name.

credentials

you can pass credentials data to create already populated tables. Provide data.frame object containing variables: timestamp, user_id, user_mail and user_pass. If there are multiple records with the same user_id, the most recent will be kept only.

credentials_pass_hashed

mandatory when putting some credentials data. Are the passwords already hashed with 'scrypt' package? Takes TRUE (if hashed) or FALSE (if not hashed and need hashing)

Value

id of the 'googlesheet' file. After creation you need to provide it to login_server().

Examples

if(googlesheets4::gs4_has_token()){

gsheet.id <- create_gsheet_db()

database <- gsheet_get_db(gsheet.id)

# you can then pass 'gsheet.id' to you 'login_server' call
#
# login_server(db_method = "gsheet",
#              gsheet_file = gsheet.id,
#              ...)
#

print(database)

googledrive::drive_trash(gsheet.id)

}

shiny.reglog documentation built on Aug. 31, 2022, 1:06 a.m.