javascript/syncbase: Renaming (app/db).delete() to destroy()
throughout the service definition and client APIs.
This change is being done as part of usability changes
as documented on https://v.io/i/672
MultiPart: 3/5
Change-Id: I013e59bd16cb52425896d015c2583c350a4268a4
diff --git a/src/app.js b/src/app.js
index 83d63c1..8c5cce0 100644
--- a/src/app.js
+++ b/src/app.js
@@ -52,9 +52,9 @@
this._wire(ctx).create(ctx, perms, cb);
};
-// delete deletes this app.
-App.prototype.delete = function(ctx, cb) {
- this._wire(ctx).delete(ctx, cb);
+// destroy destroys this app.
+App.prototype.destroy = function(ctx, cb) {
+ this._wire(ctx).destroy(ctx, cb);
};
// exists returns true only if this app exists. Insufficient permissions cause
diff --git a/src/gen-vdl/v.io/v23/services/syncbase/index.js b/src/gen-vdl/v.io/v23/services/syncbase/index.js
index 50d475b..aaf142d 100644
--- a/src/gen-vdl/v.io/v23/services/syncbase/index.js
+++ b/src/gen-vdl/v.io/v23/services/syncbase/index.js
@@ -128,8 +128,8 @@
};
-App.prototype.delete = function(ctx, serverCall) {
- throw new Error('Method Delete not implemented');
+App.prototype.destroy = function(ctx, serverCall) {
+ throw new Error('Method Destroy not implemented');
};
@@ -179,8 +179,8 @@
{
- name: 'Delete',
- doc: "// Delete deletes this App.",
+ name: 'Destroy',
+ doc: "// Destroy destroys this App.",
inArgs: [],
outArgs: [],
inStream: null,
diff --git a/src/gen-vdl/v.io/v23/services/syncbase/nosql/index.js b/src/gen-vdl/v.io/v23/services/syncbase/nosql/index.js
index 1324162..2d12483 100644
--- a/src/gen-vdl/v.io/v23/services/syncbase/nosql/index.js
+++ b/src/gen-vdl/v.io/v23/services/syncbase/nosql/index.js
@@ -978,8 +978,8 @@
};
-Database.prototype.delete = function(ctx, serverCall, schemaVersion) {
- throw new Error('Method Delete not implemented');
+Database.prototype.destroy = function(ctx, serverCall, schemaVersion) {
+ throw new Error('Method Destroy not implemented');
};
@@ -1199,8 +1199,8 @@
{
- name: 'Delete',
- doc: "// Delete deletes this Database.",
+ name: 'Destroy',
+ doc: "// Destroy destroys this Database, permanently removing all of its data.",
inArgs: [{
name: 'schemaVersion',
doc: "",
diff --git a/src/nosql/database.js b/src/nosql/database.js
index 99e4bb6..e141359 100644
--- a/src/nosql/database.js
+++ b/src/nosql/database.js
@@ -94,12 +94,12 @@
};
/**
- * Deletes this Database.
+ * Destroys this Database, permanently removing all of its data.
* @param {module:vanadium.context.Context} ctx Vanadium context.
* @param {function} cb Callback.
*/
-Database.prototype.delete = function(ctx, cb) {
- this._wire(ctx).delete(ctx, this.schemaVersion, cb);
+Database.prototype.destroy = function(ctx, cb) {
+ this._wire(ctx).destroy(ctx, this.schemaVersion, cb);
};
/**
diff --git a/test/integration/test-app.js b/test/integration/test-app.js
index 597a569..ef2a68e 100644
--- a/test/integration/test-app.js
+++ b/test/integration/test-app.js
@@ -100,7 +100,7 @@
});
});
-test('Deleting an app', function(t) {
+test('Destroy an app', function(t) {
setupApp(t, function(err, o) {
if (err) {
return t.end(err);
@@ -114,8 +114,8 @@
cb(null);
},
- // Delete app.
- o.app.delete.bind(o.app, o.ctx),
+ // Destroy app.
+ o.app.destroy.bind(o.app, o.ctx),
// Verify app no longer exists.
o.app.exists.bind(o.app, o.ctx),
diff --git a/test/integration/test-database.js b/test/integration/test-database.js
index 007c477..98b1ee4 100644
--- a/test/integration/test-database.js
+++ b/test/integration/test-database.js
@@ -175,7 +175,7 @@
});
});
-test('db.delete() deletes a database', function(t) {
+test('db.destroy() destroys a database', function(t) {
setupApp(t, function(err, o) {
if (err) {
return t.end(err);
@@ -194,8 +194,8 @@
cb(null);
},
- // Delete database.
- db.delete.bind(db, o.ctx),
+ // Destroy database.
+ db.destroy.bind(db, o.ctx),
// Verify database no longer exists.
db.exists.bind(db, o.ctx),
@@ -210,7 +210,7 @@
});
});
-test('deleting a db that has not been created should not error', function(t) {
+test('destroying a db that has not been created should not error', function(t) {
setupApp(t, function(err, o) {
if (err) {
return t.end(err);
@@ -218,7 +218,7 @@
var db = o.app.noSqlDatabase(uniqueName('db'));
- db.delete(o.ctx, function(err) {
+ db.destroy(o.ctx, function(err) {
t.error(err);
o.teardown(t.end);
});