Navigation Menu

Skip to content

Commit

Permalink
Use tableExistsSync()
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Aug 22, 2012
1 parent f6b7a76 commit c1fccfc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 1 addition & 4 deletions lib/database/domain.js
Expand Up @@ -417,10 +417,7 @@ Domain.prototype = {
},

hasSynonymsTableSync: function() {
var tables = this.context.tableListSync();
return tables.some(function(table) {
return table.name === this.synonymsTableName;
}, this);
return this.context.tableExistsSync(this.synonymsTableName);
},

exists: function() {
Expand Down
7 changes: 7 additions & 0 deletions lib/wrapped-nroonga.js
Expand Up @@ -86,6 +86,13 @@ Context.prototype = {
return formatResults(result);
},

tableExistsSync: function(tableName) {
var tables = this.tableListSync();
return tables.some(function(table) {
return table.name == tableName);
});
},

columnListSync: function(tableName) {
var result = this.commandSync('column_list', { table: tableName });
return formatResults(result);
Expand Down

0 comments on commit c1fccfc

Please sign in to comment.