db_createLinkTable | R Documentation |
creates a 'link' table for many to many relations
db_createLinkTable(
db,
tableName = NA,
leftTableName,
leftID = defaultPrimaryKey(),
rightTableName,
rightID = defaultPrimaryKey(),
addPrimary = FALSE,
includeUniqueConstraint = TRUE,
primaryKeyName = defaultPrimaryKey(),
dbType = "SQLite"
)
db |
database access 'handle' |
tableName |
name of the 'link' table to create. If NA (default), then it will create a name like this: leftTableName_rightTableName |
leftTableName |
name of the so-called left table |
leftID |
name of the column in the left table to be used for the relations. This should be a unique identifier, so preferable a primary key |
rightTableName |
name of the so-called right table |
rightID |
name of the column in the right table to be used for the relations. This should be a unique identifier, so preferable a primary key |
addPrimary |
add a autoincremented primary key (default = FALSE) |
includeUniqueConstraint |
if TRUE, then the two columns containing the foreign keys are set to be unique pairs. Note that this has consequences for the db_writeTable() function |
primaryKeyName |
name of the primary key if used (default = "id_") |
dbType |
default is "SQLite", only one alternative ("MySQL") has been tested |
nothing
leftID is always column 1, rightID is always column 2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.