что я делаю не так?
const mariadb = require("mariadb");
(() => {
setTimeout(async () => {
console.log("connecting to db...");
try {
const pool = await mariadb.createPool({
host: "localhost", //172.17.0.1
user: "root",
database: "gamifydb",
port: "3306",
password: "password"
});
const conn = await pool.getConnection();
global.conn = conn;
console.log("mariadb db connected");
} catch (error) {
throw error;
}
}, 1000);
})();
const achievement = {
name: "lorem",
user_id: "lorem",
challenge_id:2,
desc:"lorem"
}
exports.createAchievement = async achievement => {
try {
const response = await global.conn.query(
"INSERT INTO achievements value (?,?,?,?);",
Object.values(achievement)
);
console.log(response);
return response;
} catch (error) {
throw error;
}
};
"(conn = 1194, no: 1136, SQLState: 21S01) Количество столбцов не соответствует количеству значений в строка 1 \ n sql: значение INSERT INTO для достижений (?,?,?,?); - параметры: ['lorem', 'lorem', 2, 'lorem'] "}