X
X
xonar2019-09-13 03:09:22
MySQL
xonar, 2019-09-13 03:09:22

How to convert sequalize option to plain sql?

Hello. There are sequalize queries, but you need to translate them into simple sql queries in order to manually insert them into phpmyadmin. How to do it? Are there converters online? (Google did not find).

Id: {
 type: DataTypes.INTEGER,
 primaryKey: true,
 autoIncrement: true,
 },
 uid: DataTypes.INTEGER,
 message: DataTypes.TEXT,
 time: DataTypes.DATE,
 is_coupon: {
 type: DataTypes.BOOLEAN,
 allowNull: false,
 defaultValue: false,
 },
 is_ban: {
 type: DataTypes.BOOLEAN,
 allowNull: false,
 defaultValue: false,
 },
}, {
 timestamps: false,
 name: { singular: "message", plural: "chat" },
 tableName: "chat",
});

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
index0h, 2019-09-13
@index0h

debug help. sequalize and is the sql generator for your case.

R
Robur, 2019-09-13
@Robur

Turn on the sequelize logs, it will dump all the sql queries that it makes into the console. Then you just need to initiate this request in the application, and copy-paste.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question