curl -fsSL https://deb.nodesource.com/setup_19.x | bash - &&\
apt-get install -y nodejs
create table comments (
"name" varchar,
"commens" varchar,
"like" int,
"date" timestamp
);
insert into comments
select (json_populate_record(null::comments, value)).* from json_array_elements('[
{
"name": "name1",
"commens": "commens1",
"like": 2,
"date": "2022-01-01"
},{
"name": "name2",
"commens": "commens2",
"like": 2,
"date": "2022-01-01"
},{
"name": "name3",
"commens": "commens3",
"like": 2,
"date": "2022-01-01"
}
]');
select * from comments;
const arr = await getStartEndDateInTradePage.findAll(
{
attributes: ['open_date', 'close_date'],
where: {
close_date: {
[Op.ne]: '-'
}
}
}
)
if(text === 'Магазин'){
man = connection.query('SELECT * FROM `products`', function(error,results){
if(error) {throw error}
for (let i in results) {
bot.sendMessage(chatId, `Продукты: \nИмя: ${results[i]['name']} Цена: ${results[i]['price']}`);
bot.sendMessage(chatId, results[i]['name']);
}
});
}