Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Commit

Permalink
implements #130
Browse files Browse the repository at this point in the history
  • Loading branch information
arafato committed Feb 27, 2018
1 parent 3af5c56 commit 33e623c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/core/table/TableStorageManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class TableStorageManager {
}

deleteTable(request) {
const coll = this.db.getCollection(Tables.Tables);
coll.chain().find({ name: { '$eq': request.tableName } }).remove();
this.db.removeCollection(request.tableName);
return BbPromise.resolve(new AzuriteTableResponse({}));
}

Expand Down
5 changes: 5 additions & 0 deletions lib/middleware/table/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const BbPromise = require('bluebird'),
Operations = require('./../../core/Constants').Operations.Table,
insertEntity = require('./../../actions/table/InsertEntity'),
deleteTable = require('./../../actions/table/DeleteTable'),
createTable = require('./../../actions/table/CreateTable');

module.exports = (req, res) => {
Expand All @@ -26,4 +27,8 @@ actions[Operations.CREATE_TABLE] = (request, res) => {

actions[Operations.INSERT_ENTITY] = (request, res) => {
insertEntity.process(request, res);
}

actions[Operations.DELETE_TABLE] = (request, res) => {
deleteTable.process(request, res);
}

0 comments on commit 33e623c

Please sign in to comment.