Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7601221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:07:01+00:00 2026-05-30T23:07:01+00:00

Here are some questions about features supported by sequelize ( sequelize project site )

  • 0

Here are some questions about features supported by sequelize (sequelize project site) that I would like to clear up before deciding whether or not to use it:

  1. Chaining (efficiency): when chaining multiple queries, are these collected into one request to the database (as a batch of operations), or is each one sent separately?

  2. Chaining (success/error): when chaining multiple queries, when is the success event emitted and what happens on error? Is “success” emitted only if all operations succeeded? And if there was an error, does it rollback all operations (i.e. are the chained operations treated as a transaction)

  3. Filtering associations: Say a Crowd object has the relation Crowd.hasMany(Person). You can get all the associated people by executing crowd.getPersons(), but is it possible to select a subset of them, like crowd.getPersons({where: { age: 30 }})?

  4. Getting associated objects that are related by two or more steps: Say a Crowd object as the relation Crowd.hasMany(Person) and Person has the relation Person.hasMany(Pet). Is it possible to get all the pets of people in a crowd by executing something like crowd.getPersons().getPets(), and if so does this get sent as multiple request to the database, or just one request?

  5. “Deep” object: I want to define a person as the object:

    sequelize.define('Person', {
        name: {
            first: <a string>,
            last: <a string>
        }
    });
    

    Is this allowed? (Note that name is not going to be a column of the database table, but first and last will be)

  6. “Calculated” object: Is it possible to add a field to the object that is calculated from other fields of the object? For example:

    sequelize.define('Person', {
        name: {
            first: <a string>,
            last: <a string>,
            full: <name.first + ' ' + name.last> // <-- this field
        }
    });
    

    So that the name.full field isn’t actually stored in the database (which is a waste of space) but rather just calculated from the other two?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:07:02+00:00Added an answer on May 30, 2026 at 11:07 pm

    1.: You can use for super duper batch processing the QueryChainer. Nevertheless, every command will be executed separated.

    2.: Using the QueryChainer, the success event will only be triggered if everything was fine. Error is triggered if there occured one or multiple errors. The first param of the bound method will be an array of errors.

    3.: Hmm I’m not 100% sure, but imho it’s not yet supported.

    4.: Nope not possible but more complicated and less fancy with:

    crowd.getPeople().success(function(people) {
      people.forEach(function(person){
        person.getPets().success... // you have to collect them on your own
      })
    })
    

    5.: Nope. But I also don’t understand why you would do that.

    6.: Yep, check this http://sequelizejs.com/docs/1.7.8/models#expansion-of-models and:

    Person = sequelize.define('Person', {foo:Sequelize.STRING}, {
      instanceMethods: {
        fullname: function() {
          return this.firstName + ' ' + this.lastName
        }
      }
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Reading some questions here on SO about conversion operators and constructors got me thinking
Reading through some of the questions here, the general concensus seems to be that
Here are already several questions in SO about the safe template languages , like:
I've seen several question on here about exceptions , and some of them hint
I've looked into some questions here where the best programming books are listed and
After reading a couple of answers and comments on some SQL questions here, and
I already check some of asp.net mvc hosting sites listed here: https://stackoverflow.com/questions/637567/affordable-stable-asp-net-mvc-hosting-exist I worry
I am learning to solve some runtime error with gdb. Here are my questions:
I have an other active question HERE regarding some hopeless memory issues that possibly
I have a few quick questions about the iPhone software development. I did some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.