chrdevmar / merge-sequelize-options Goto Github PK
View Code? Open in Web Editor NEWUtility for merging sequelize options objects
Utility for merging sequelize options objects
implement merging of order clauses defined with the following syntax:
Subtask.findAll({
order: [
// Will order by an associated model's created_at using the name of the association.
['Task', 'createdAt', 'DESC']
]
})
implement merging of order options declared with the following syntax:
Subtask.findAll({
// Will order by max age ascending assuming ascending is the default order when direction is omitted
order: sequelize.fn('max', sequelize.col('age'))
})
implement merging for order clauses defined with the following syntax:
Subtask.findAll({
order: [
// Will order an associated model's created_at using the model name as the association's name.
[Task, 'createdAt', 'DESC'],
// Will order by an associated model's created_at using an association object. (preferred method)
[Subtask.associations.Task, 'createdAt', 'DESC'],
]
})
implement merging for order clauses declared with the following syntax:
Subtask.findAll({
order: [
// Will order by a nested associated model's created_at using the names of the associations.
['Task', 'Project', 'createdAt', 'DESC']
]
})
this will probably not show in the list of issues
implement merging for order options declared with the following syntax:
Subtask.findAll({
order: [
// Will order by max(age)
sequelize.fn('max', sequelize.col('age')),
]
})
implement merging of order options with the following syntax:
Subtask.findAll({
// Will order randomly based on the dialect (instead of fn('RAND') or fn('RANDOM'))
order: sequelize.random()
})
implement logic for merging order elements declared with the following syntax:
Subtask.findAll({
order: [
// Will order by max(age)
sequelize.fn('max', sequelize.col('age')),
]
})
implement merging of order clauses defined with the following syntax:
Subtask.findAll({
order: [
// Will order through an associated model's created_at using the model names as the associations' names.
[Task, Project, 'createdAt', 'DESC'],
// Will order by a nested associated model's created_at using association objects. (preferred method)
[Subtask.associations.Task, Task.associations.Project, 'createdAt', 'DESC'],
]
})
implement merging of order options declared with the following syntax:
Subtask.findAll({
// Will order by age ascending assuming ascending is the default order when direction is omitted
order: sequelize.col('age')
})
implement merging of order options declared with the following syntax:
Subtask.findAll({
order: [
// Will order by a nested associated model's created_at simple association objects.
[{model: Task, as: 'Task'}, {model: Project, as: 'Project'}, 'createdAt', 'DESC']
]
})
implement merging for order clauses defined with the following syntax:
Subtask.findAll({
order: [
// Will order by max(age) DESC
[sequelize.fn('max', sequelize.col('age')), 'DESC'],
]
})
implement merging of order options declared with the following syntax:
Subtask.findAll({
order: [
// Will order by an associated model's created_at using a simple association object.
[{model: Task, as: 'Task'}, 'createdAt', 'DESC']
]
})
implement merging of order options declared with the following syntax:
Subtask.findAll({
order: [
// Will order by an associated model's created_at using the name of the association.
['Task', 'createdAt', 'DESC']
]
})
implement merging of order options declared with the following syntax:
Subtask.findAll({
// Will order by max age descending
order: sequelize.literal('max(age) DESC')
})
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.