【问题标题】:Typescript, and typeorm problemsTypescript 和 typeorm 问题
【发布时间】:2020-04-29 15:01:30
【问题描述】:

QueryFailedError: SQLITE_ERROR: near "Jan": syntax error.这对我来说完全没有意义,我以前做过的任何事情,但这次似乎是在说它要慢或什么的。

【问题讨论】:

  • 抛出错误的 SQL 是什么?
  • 查询失败:CREATE TABLE "infractions" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "guild" bigint NOT NULL, "moderator" bigint NOT NULL, "target" bigint NOT NULL, "reason " varchar NOT NULL, "time" date NOT NULL DEFAULT (Sun Jan 12 2020 16:17:20 GMT-0500 (Eastern Standard Time)))

标签: sql typescript sqlite syntax typeorm


【解决方案1】:

由于您的 time 列上的默认值,它看起来会引发错误。

我建议看看那个。将默认值更改为 date('now')(如您标记 sqlite)应该可以解决问题,具体取决于您的用例

【讨论】:

    猜你喜欢
    • 2020-01-05
    • 2018-10-04
    • 2020-12-11
    • 2019-01-31
    • 1970-01-01
    • 2020-01-03
    • 1970-01-01
    • 2021-07-16
    • 2019-02-21
    相关资源
    最近更新 更多