Creates a new record in the data source.
Returns a Promise object or the 'this' object.
Options is a struct that can have the following items, all of which are optional.
Hostvars is a set of (temporary) name-value pairs that are passed as column values to the record being created. By default, hostvars is the empty set.
Initial-values is a set of (temporary) name-value pairs that override the default initial values of the newly created record. By default, initial-values is the empty set.
Rows is an array of predefined rows to be created.
Before is a boolean that specifies whether the new record must be created before or after the currently selected record. By default, it is created before.
Copy-values is a boolean that specifies whether all field values must be duplicated from the record currently selected, or not. By default, this duplication does not happen.
Promise determines the return value of this function. If promise has the value of 'true' (the default), a Promise object is returned. If promise has the value of 'false', the ‘this’ object is returned instead.
Success-function is a function called after a record has been successfully created *.
Error-function is a function called if an error occurs.
* NOTE: If you pass success-function, you can use the return value of this function to control whether the record is actually created.
A shorter version of the above example is:
This example creates an array of predefined rows: