All Questions
2,530
questions
-2
votes
2
answers
33
views
Can i make a flexible function that can get * from different tables? [duplicate]
I am trying to create a function that can select from different tables in mysql
My Function
async function getOne(table, table_parameter, parameter) {
const result = await pool.query(
`SELECT * ...
0
votes
0
answers
30
views
How to host the backend of my React Native app? [duplicate]
I have a React Native app with ExpressJS backend and mySQL database. How do I host my server? I'm planning to have sort of like a demo app just for presentation.
I tried using Heroku but I find it too ...
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
20
views
How to properly perform one-to-many relationship query in sequelize-typescript?
I've a question to ask and probably would like to apply it on my personal project. I have Photo and Album as my tables and subsequently on my code as my data models:
Album.ts
import { Column, ...
-1
votes
2
answers
88
views
MySQL insert query successful but not inserting into database table
I am working on a React/MySQL registration page. The insert query runs, but is not inserting into the database table. I am not sure why.
In the backend folder, I have my server.js file:
const ...
0
votes
0
answers
24
views
Express-Session with MySQLStore not persisting sessions in MySQL database
I am using express-session and express-mysql-session to manage sessions in my Node.js application with a MySQL database. While the session store initializes successfully and a sessions table is ...
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
24
views
How to manage multiple query requests from same endpoint with Express server
I have a react website that has a page (movie detail) from where I need to query mySQL tables in order to display content. I am using Express server as middlewhere to receive the calls, make DB query ...
0
votes
0
answers
15
views
How to solve many-to-many relationship for inserting an element in Sequelize?
I have the following tables in my MySQL database:
CREATE TABLE idi_ma_products (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(200),
image VARCHAR(255),
created_date DATE,
...
0
votes
0
answers
32
views
Trouble in Insert MySql Workbench
Only createAt, updateAt and the registration ID are inserted - the 'email' and 'password' fields are empty, giving insert in the other fields and not in the two:
Executing (default): INSERT INTO '...
0
votes
0
answers
13
views
throw new Error(`A column called 'id' was added to the attributes of '${this.tableName}' but not marked with 'primaryKey: true'`);
i have an error with this table but ia already migrate with fluently, whats wrong with this? anyone can help?
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface....
0
votes
0
answers
30
views
Sequelize findAndCountAll with literal count and having clause and subquery getting column not found on subquery column for count,
Sequelize findAndCountAll with having clause and subquery getting column not found on subquery column for count,
tried subQuery:false and subQuery:true but not worked,
tried with finAll but i need ...
0
votes
1
answer
61
views
Encoding problem UTF-8 in docker backend image
i try to create mysql and nodejs express image
when i run mysql and backend container and open my frontend
english text can display but if data is thai text when i use mysql2 to fetch thai text
the ...
0
votes
0
answers
13
views
import 'exported' sql file into mysql database using node.js
I had one sql file which i want to import in my new database using node.js.
I have tried multiple ways but no progress
This error i receive when i try readFile approach
Error executing SQL file: ...
0
votes
1
answer
32
views
Stringified JSON data won't INSERT into mySQL(verified json format)
I'm not able to insert a JSON string into a mySQL table.
CREATE TABLE registered (
id int NOT NULL AUTO_INCREMENT,
name nvarchar(128) NOT NULL,
panels JSON NOT NULL,
PRIMARY KEY (id)
);...