Questions tagged as 'sequelize-js'

1
answer

Promises as function return on node.js

I'm using the Sequelize.js framework. to perform queries on the database, the result of the find function returns an object with 3 methods: success , error and complete Ex: models.ItensPedido.findAll( {where : {...
asked by 13.06.2014 / 21:22
1
answer

How to make synchronous queries with Sequelize in Node.js

I started porting Node.js recently and I'm using the division of logic into modules. I have UserSessionController that validates if the user session is still valid: module.exports.getUserSession = function ( userToken ) { mod...
asked by 29.05.2014 / 15:57
1
answer

User profiles for REST API access using NodeJS + ORM SequelizeJS

Is there a way, or some nice package, to work with user profiles for access to certain REST API endpoints as per their permission? I'm using NodeJS + Express + SequelizeJS as ORM.     
asked by 05.12.2016 / 16:49
1
answer

Error GraphQL with Sequelize

I'm having an error in the return of a Mutation . Apparently it can not read the id field, but the object I'm sending to GraphQL has this field, and since I'm new to GraphQL I did not understand what the error means. The error: { "e...
asked by 28.02.2018 / 22:26
2
answers

Where in Join - Sequelize

Hello, I want to do a search inside several tables, for example: SELECT * from tab1 INNER JOIN tab2 ON tab1.tab2_id = tab2.id WHERE tab1.name LIKE '%blabla%' or tab2.title LIKE '%blablabla%' How would you do this query with S...
asked by 23.09.2016 / 22:06
1
answer

Error starting project nodejs + Sequelize + mysql

When I try to start my project, it gives the following error: D:\www\nodejs\master>node bin/www module.js:472 throw err; ^ Error: Cannot find module 'sequelize' at Function.Module._resolveFilename (module.js:470:15) at Func...
asked by 16.04.2017 / 06:23
1
answer

Double association with sequelize

I have the following relation with the sequelize // Tasks.js sequelize.models.tasks.belongsTo(sequelize.models.users, { foreignKey: { type: DataTypes.INTEGER, field: 'ASSIGNEE', allowNull: true }, as: 'assignee' }); s...
asked by 08.01.2017 / 14:12
1
answer

Configure API for SQL Server database

I have an API that I used with MySQL, but I had to switch to SQL Server. Unfortunately I've never used SQL Server, I do not know if I need to download something to get it. The API was done in JS. The configuration of the sequelize of my API with...
asked by 08.03.2018 / 13:02
0
answers

Error creating a table with sequelize "TypeError: Can not read property 'sequelize' of undefined"

I'm having the following error when trying to create a table:    const User = app.db.sequelize.define ('user', {       TypeError: Can not read property 'sequelize' of undefined My folder structure: Myconfigurationfile(server.js)mo...
asked by 06.02.2018 / 15:50
0
answers

Sequelize and Google Cloud Storage

Does anyone know how to connect the plugin "sequelize" nodejs to connect to an instance of google cloud. I already created the instance in mysql everything is ready missing only the connection. var sequelize = new Sequelize('database_name', 'u...
asked by 07.12.2017 / 13:31