Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

290
Visualizações
Node Mysql Insert and Modify shorthand from object with 1 conversion

There is a very useful shorthand for Node Mysql where it automatically spreads all object values as column values like this:

'INSERT INTO `table` SET ? ;', [someobject]

or

'UPDATE `table` set ? WHERE id = ?',[someobject,id]

This is very handy as it allow for maintainable code with very large objects (30+ columns)

But one of the columns is a Timestamp value in Mysql and the data on the node app is as a Linux timestamp (integer), Mysql doesn't automatically map this integer. I usually do something like : FROM_UNIXTIME(?) to automatically convert this to a full date string on the (database) server.

How can I keep this shorthand technique with a timestamp insertion? I could modify this parameter beforehand in node, but nothing guarantees me the node server and the database are on the same timezone.

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda