add_key: Add a key to a keyring

View source: R/database.R

add_keyR Documentation

Add a key to a keyring

Description

Add a new key to the keyring to store a new database connection string. If the keyring is locked then unlock it first with its password.

Usage

add_key(keyring_name, service_name)

Arguments

keyring_name

A character string providing the name of the keyring.

service_name

A character string providing the name of the key.

Details

On creating the key, the name of the key relating to the database is added under the service name and the database connections string is added as a json string in the password dialog box.

  • SQL Server windows authentication: {"server":"SERVER_NAME", "database":"DATABASE_NAME"}.

  • PostGresSQL database: {"server":"SERVER_NAME", "database":"DATABASE_NAME", "username":"USERNAME", "password":"PASSWORD"}.

  • For SQLEXPRESS on the local machine the server name is "localhost\SQLEXPRESS". (need to escape back slash with double back slashes)

See Also

Other keyring functions: create_locked_keyring(), delete_keyring(), delete_key(), get_keyring_status(), list_keyrings(), list_keys(), lock_keyring(), unlock_keyring(), view_key()


gcfrench/store documentation built on May 17, 2024, 5:52 p.m.