All Questions
Tagged with express sequelize.js
1,852
questions
0
votes
0
answers
21
views
why does findOne method on sequelize just compare on the Id column of table
so this code that is a route I have created using sequelize library on mysql database
const { user_name } = req.params;
const user = await User.findOne({ where: { username: user_name } });
it has to ...
0
votes
1
answer
34
views
ORM Sequelize model.upsert() is not a function
Version sequelize 6.37.3
I try to upsert() myModel but the mehtod returns:
TypeError: model.upsert is not a function
my_model.controller.ts
...
class MyModelController {
private model: any;
....
0
votes
0
answers
46
views
How to query two Sequelize models through a junction table? Sequelize throwing error on 'through: model'
I am writing a webapp for practice. I have several sequelize models, and querying the db through them so far has been no issue. However, when I tried to use a junction table to return what would be a ...
0
votes
0
answers
49
views
Setting up SQL Server 2012 (v11.0.0) in Node.JS v20.15.0 as Backend API or Data Access Layer Structure
I need to set add-ons on my Flutter project, this is a Backend API using Node.JS which will serve as a middleman API for my Flutter project to retrieve and manage data from database in any platform (e....
0
votes
0
answers
35
views
How can I relate models with sequelize in express
I am not being able to make an association between my models, I am using postman to consult a specific provider, for example: Get in http://localhost:3000/api/proveedores/1
My relationship is one to ...
0
votes
1
answer
63
views
How to get list of column names from a query that won't return any rows
I am using MySQL, ExpressJS, and Sequelize to build a function that returns a list of columns from a given SQL query. The function should work even if the query returns no rows.
Here is the current ...
0
votes
1
answer
36
views
ERROR : Sequelize model foreign keys not defined correctly
I have 2 table schemas Customer and Cart
Customer.js
module.exports = (sequelize, DataTypes) => {
const Customer = sequelize.define("custom", {
id: {
type: ...
0
votes
0
answers
28
views
How to establish a one-to-many relationship using sequelize in Nodejs?
I have a model called users.model.js
const postsModel = require("../Posts/posts.model");
const User = sequelize.define(
'User',
{
id: {
type: DataTypes.UUID,
...
0
votes
1
answer
22
views
How do I search an entry in database by the same search phrase for two separate models with reference in sequelize?
I'm trying to make a search in a database for invoices. In the server request handler I have only one thing: searchPhrase. So I have to search invoice by serial number of the invoice, and also by ...
0
votes
0
answers
53
views
Is it possible to use an associated model's property as a title in Adminjs?
Background
I have an app for game collecting. In this context, the properties of the game itself are not necessarily important. Instead, we really care about the actual different releases of an ...
0
votes
1
answer
27
views
Sequelize in test files doesnt get test environment
I´m using sequelize as ORM and jest for testing.
Im running two databases currently with docker compose (test and development).
Environment variables are correct in console.log. For one rease Database ...
0
votes
1
answer
51
views
Sequelize transaction rollback not working
I am creating a project using express.js where I want to group one or more database queries performed using sequelze.js and PostgreSQL to create a transaction. I have created managed transaction using ...
0
votes
0
answers
22
views
Automatic creation of records in database tables
I have an Express application, PostgreSQL is used as a database, and Sequelize is used as an ORM.
I connect to the database as follows:
import { Sequelize } from "sequelize-typescript";
...
0
votes
2
answers
91
views
Client does not support authentication protocol 'auth_gssapi_client' requested by server in MariaDB-React ts
I have problem when i want start express server, i got the following error
Unable to connect to the database: ConnectionError [SequelizeConnectionError]: (conn:3, no: 45025, SQLState: 08004) Client ...
0
votes
0
answers
24
views
Model Import fails ExpressJS / Sequelize fail?
Hey guys I am building a fullstack website to to learn Express , Sequelize and REST api
I have this model for a post request ``
module.exports = (sequelize, DataTypes) => {
const PaymentMethods = ...