不要怂,就是干,撸起袖子干!

Commit 2fa8a6e4 by sdepold

refactored query-generator

1 parent 40911a89
......@@ -5,14 +5,14 @@ module.exports = (function() {
Attributes should have the format: {attributeName: type, attr2: type2} --> {title: 'VARCHAR(255)'}
*/
createTableQuery: function(tableName, attributes, options) {
throwMethodUndefined.call('createTableQuery')
throwMethodUndefined('createTableQuery')
},
/*
Returns a query for dropping a table.
*/
dropTableQuery: function(tableName, options) {
throwMethodUndefined.call('dropTableQuery')
throwMethodUndefined('dropTableQuery')
},
/*
......@@ -22,7 +22,7 @@ module.exports = (function() {
- futureTableName: Name of the table after execution.
*/
renameTableQuery: function(originalTableName, futureTableName) {
throwMethodUndefined.call('renameTableQuery')
throwMethodUndefined('renameTableQuery')
},
/*
......@@ -37,7 +37,7 @@ module.exports = (function() {
- allowNull: Boolean
*/
addColumnQuery: function(tableName, attributes) {
throwMethodUndefined.call('addColumnQuery')
throwMethodUndefined('addColumnQuery')
},
/*
......@@ -47,7 +47,7 @@ module.exports = (function() {
- attributeName: Name of the obsolete attribute.
*/
removeColumnQuery: function(tableName, attributeName) {
throwMethodUndefined.call('removeColumnQuery')
throwMethodUndefined('removeColumnQuery')
},
/*
......@@ -62,7 +62,7 @@ module.exports = (function() {
- allowNull: Boolean
*/
changeColumnQuery: function(tableName, attribute) {
throwMethodUndefined.call('changeColumnQuery')
throwMethodUndefined('changeColumnQuery')
},
/*
......@@ -73,7 +73,7 @@ module.exports = (function() {
- attrNameAfter: The name of the attribute, after renaming.
*/
renameColumnQuery: function(tableName, attrNameBefore, attrNameAfter) {
throwMethodUndefined.call('renameColumnQuery')
throwMethodUndefined('renameColumnQuery')
},
/*
......@@ -90,14 +90,14 @@ module.exports = (function() {
- offset -> An offset value to start from. Only useable with limit!
*/
selectQuery: function(tableName, options) {
throwMethodUndefined.call('selectQuery')
throwMethodUndefined('selectQuery')
},
/*
Returns an insert into command. Parameters: table name + hash of attribute-value-pairs.
*/
insertQuery: function(tableName, attrValueHash) {
throwMethodUndefined.call('insertQuery')
throwMethodUndefined('insertQuery')
},
/*
......@@ -111,7 +111,7 @@ module.exports = (function() {
If you use a string, you have to escape it on your own.
*/
updateQuery: function(tableName, values, where) {
throwMethodUndefined.call('updateQuery')
throwMethodUndefined('updateQuery')
},
/*
......@@ -126,7 +126,7 @@ module.exports = (function() {
- limit -> Maximaum count of lines to delete
*/
deleteQuery: function(tableName, where, options) {
throwMethodUndefined.call('deleteQuery')
throwMethodUndefined('deleteQuery')
},
/*
......@@ -145,22 +145,29 @@ module.exports = (function() {
- parser
*/
addIndexQuery: function(tableName, attributes, options) {
throwMethodUndefined.call('addIndexQuery')
throwMethodUndefined('addIndexQuery')
},
/*
Returns an show index query.
Parameters:
- tableName: Name of an existing table.
- options:
- databaseName: Name of the database.
*/
showIndexQuery: function(tableName, options) {
throwMethodUndefined.call('showIndexQuery')
throwMethodUndefined('showIndexQuery')
},
removeIndexQuery: function(tableName, options) {
throwMethodUndefined.call('removeIndexQuery')
throwMethodUndefined('removeIndexQuery')
},
/*
Takes something and transforms it into values of a where condition.
*/
getWhereConditions: function(smth) {
throwMethodUndefined.call('getWhereConditions')
throwMethodUndefined('getWhereConditions')
},
/*
......@@ -168,7 +175,7 @@ module.exports = (function() {
The values are transformed by the relevant datatype.
*/
hashToWhereConditions: function(hash) {
throwMethodUndefined.call('hashToWhereConditions')
throwMethodUndefined('hashToWhereConditions')
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!