Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 2fa8a6e4
authored
Dec 11, 2011
by
sdepold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored query-generator
1 parent
40911a89
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
16 deletions
lib/connectors/mysql/query-generator.js
lib/connectors/query-generator.js
lib/connectors/mysql/query-generator.js
View file @
2fa8a6e
This diff is collapsed.
Click to expand it.
lib/connectors/query-generator.js
View file @
2fa8a6e
...
@@ -5,14 +5,14 @@ module.exports = (function() {
...
@@ -5,14 +5,14 @@ module.exports = (function() {
Attributes should have the format: {attributeName: type, attr2: type2} --> {title: 'VARCHAR(255)'}
Attributes should have the format: {attributeName: type, attr2: type2} --> {title: 'VARCHAR(255)'}
*/
*/
createTableQuery
:
function
(
tableName
,
attributes
,
options
)
{
createTableQuery
:
function
(
tableName
,
attributes
,
options
)
{
throwMethodUndefined
.
call
(
'createTableQuery'
)
throwMethodUndefined
(
'createTableQuery'
)
},
},
/*
/*
Returns a query for dropping a table.
Returns a query for dropping a table.
*/
*/
dropTableQuery
:
function
(
tableName
,
options
)
{
dropTableQuery
:
function
(
tableName
,
options
)
{
throwMethodUndefined
.
call
(
'dropTableQuery'
)
throwMethodUndefined
(
'dropTableQuery'
)
},
},
/*
/*
...
@@ -22,7 +22,7 @@ module.exports = (function() {
...
@@ -22,7 +22,7 @@ module.exports = (function() {
- futureTableName: Name of the table after execution.
- futureTableName: Name of the table after execution.
*/
*/
renameTableQuery
:
function
(
originalTableName
,
futureTableName
)
{
renameTableQuery
:
function
(
originalTableName
,
futureTableName
)
{
throwMethodUndefined
.
call
(
'renameTableQuery'
)
throwMethodUndefined
(
'renameTableQuery'
)
},
},
/*
/*
...
@@ -37,7 +37,7 @@ module.exports = (function() {
...
@@ -37,7 +37,7 @@ module.exports = (function() {
- allowNull: Boolean
- allowNull: Boolean
*/
*/
addColumnQuery
:
function
(
tableName
,
attributes
)
{
addColumnQuery
:
function
(
tableName
,
attributes
)
{
throwMethodUndefined
.
call
(
'addColumnQuery'
)
throwMethodUndefined
(
'addColumnQuery'
)
},
},
/*
/*
...
@@ -47,7 +47,7 @@ module.exports = (function() {
...
@@ -47,7 +47,7 @@ module.exports = (function() {
- attributeName: Name of the obsolete attribute.
- attributeName: Name of the obsolete attribute.
*/
*/
removeColumnQuery
:
function
(
tableName
,
attributeName
)
{
removeColumnQuery
:
function
(
tableName
,
attributeName
)
{
throwMethodUndefined
.
call
(
'removeColumnQuery'
)
throwMethodUndefined
(
'removeColumnQuery'
)
},
},
/*
/*
...
@@ -62,7 +62,7 @@ module.exports = (function() {
...
@@ -62,7 +62,7 @@ module.exports = (function() {
- allowNull: Boolean
- allowNull: Boolean
*/
*/
changeColumnQuery
:
function
(
tableName
,
attribute
)
{
changeColumnQuery
:
function
(
tableName
,
attribute
)
{
throwMethodUndefined
.
call
(
'changeColumnQuery'
)
throwMethodUndefined
(
'changeColumnQuery'
)
},
},
/*
/*
...
@@ -73,7 +73,7 @@ module.exports = (function() {
...
@@ -73,7 +73,7 @@ module.exports = (function() {
- attrNameAfter: The name of the attribute, after renaming.
- attrNameAfter: The name of the attribute, after renaming.
*/
*/
renameColumnQuery
:
function
(
tableName
,
attrNameBefore
,
attrNameAfter
)
{
renameColumnQuery
:
function
(
tableName
,
attrNameBefore
,
attrNameAfter
)
{
throwMethodUndefined
.
call
(
'renameColumnQuery'
)
throwMethodUndefined
(
'renameColumnQuery'
)
},
},
/*
/*
...
@@ -90,14 +90,14 @@ module.exports = (function() {
...
@@ -90,14 +90,14 @@ module.exports = (function() {
- offset -> An offset value to start from. Only useable with limit!
- offset -> An offset value to start from. Only useable with limit!
*/
*/
selectQuery
:
function
(
tableName
,
options
)
{
selectQuery
:
function
(
tableName
,
options
)
{
throwMethodUndefined
.
call
(
'selectQuery'
)
throwMethodUndefined
(
'selectQuery'
)
},
},
/*
/*
Returns an insert into command. Parameters: table name + hash of attribute-value-pairs.
Returns an insert into command. Parameters: table name + hash of attribute-value-pairs.
*/
*/
insertQuery
:
function
(
tableName
,
attrValueHash
)
{
insertQuery
:
function
(
tableName
,
attrValueHash
)
{
throwMethodUndefined
.
call
(
'insertQuery'
)
throwMethodUndefined
(
'insertQuery'
)
},
},
/*
/*
...
@@ -111,7 +111,7 @@ module.exports = (function() {
...
@@ -111,7 +111,7 @@ module.exports = (function() {
If you use a string, you have to escape it on your own.
If you use a string, you have to escape it on your own.
*/
*/
updateQuery
:
function
(
tableName
,
values
,
where
)
{
updateQuery
:
function
(
tableName
,
values
,
where
)
{
throwMethodUndefined
.
call
(
'updateQuery'
)
throwMethodUndefined
(
'updateQuery'
)
},
},
/*
/*
...
@@ -126,7 +126,7 @@ module.exports = (function() {
...
@@ -126,7 +126,7 @@ module.exports = (function() {
- limit -> Maximaum count of lines to delete
- limit -> Maximaum count of lines to delete
*/
*/
deleteQuery
:
function
(
tableName
,
where
,
options
)
{
deleteQuery
:
function
(
tableName
,
where
,
options
)
{
throwMethodUndefined
.
call
(
'deleteQuery'
)
throwMethodUndefined
(
'deleteQuery'
)
},
},
/*
/*
...
@@ -145,22 +145,29 @@ module.exports = (function() {
...
@@ -145,22 +145,29 @@ module.exports = (function() {
- parser
- parser
*/
*/
addIndexQuery
:
function
(
tableName
,
attributes
,
options
)
{
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
)
{
showIndexQuery
:
function
(
tableName
,
options
)
{
throwMethodUndefined
.
call
(
'showIndexQuery'
)
throwMethodUndefined
(
'showIndexQuery'
)
},
},
removeIndexQuery
:
function
(
tableName
,
options
)
{
removeIndexQuery
:
function
(
tableName
,
options
)
{
throwMethodUndefined
.
call
(
'removeIndexQuery'
)
throwMethodUndefined
(
'removeIndexQuery'
)
},
},
/*
/*
Takes something and transforms it into values of a where condition.
Takes something and transforms it into values of a where condition.
*/
*/
getWhereConditions
:
function
(
smth
)
{
getWhereConditions
:
function
(
smth
)
{
throwMethodUndefined
.
call
(
'getWhereConditions'
)
throwMethodUndefined
(
'getWhereConditions'
)
},
},
/*
/*
...
@@ -168,7 +175,7 @@ module.exports = (function() {
...
@@ -168,7 +175,7 @@ module.exports = (function() {
The values are transformed by the relevant datatype.
The values are transformed by the relevant datatype.
*/
*/
hashToWhereConditions
:
function
(
hash
)
{
hashToWhereConditions
:
function
(
hash
)
{
throwMethodUndefined
.
call
(
'hashToWhereConditions'
)
throwMethodUndefined
(
'hashToWhereConditions'
)
}
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment