db_add_col: Add a Column (Field).

Description Usage Arguments Value Details Examples

View source: R/RMariaDBHelper.R

Description

Add a column (field) to a database table.

Usage

1
db_add_col(tablename, fieldname, fieldtype, conf_file = "~/.db_conf.yml")

Arguments

tablename

(character) A table name in a database.

fieldname

(character) A field name to add to a database table.

fieldtype

(character) A field type to set for a field added to a table.

conf_file

(character) A file containing database connection parameters. (Default: "~/.db_conf.yml")

Value

(integer) The number of rows affected by the field addition.

Details

An ALTER TABLE ... ADD COLUMN command will add a field to a table in a database.

Examples

1
2
3
4
## Not run: 
db_add_col("iris", "Species", "varchar(32)")

## End(Not run)

deohs/RMariaDBHelper documentation built on Dec. 31, 2020, 11:17 p.m.