Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to the description of db.insert #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions docs/API/SQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,26 @@ exports.down = function (db, callback)
};
```

### insert(tableName, columnNameArray, valueArray, callback)
### insert(tableName, { columnName: value }, callback)

Insert an item into a given column

__Arguments__

* tableName - table to insert the item into
* columnNameArray - the array existing column names for each item being inserted
* valueArray - the array of values to be inserted into the associated column
* callback(err) - callback that will be invoked once the insert has been completed.
* columnName - the column name for each item being inserted
* value - the array of values to be inserted into the associated column
* callback - callback that will be invoked once the insert has been completed.

```javascript
exports.up = function(db, callback)
{
db.insert('tableName',
{
columnName: 'value', columnName2: 'value2'
}, callback);
};
```

### removeIndex([tableName], indexName, callback)

Expand Down