从user使用 jOOQ调用的表中进行选择时,出现以下异常:
jOOQ; bad SQL grammar [insert into user (user_id, account_type) values (?, ?)]; nested exception is org.postgresql.util.PSQLException: ERROR: syntax error at or near "user"
我的 jOOQ 设置是:
private static final Settings jooqSettings = new Settings()
.withRenderSchema(false)
.withRenderNameStyle(RenderNameStyle.LOWER);
Run Code Online (Sandbox Code Playgroud)
我DSLContext从中创建一个并在事务中构造一个查询,如下所示:
ctx.insertInto(USER)
.set(USER.USER_ID, userId)
.set(USER.ACCOUNT_TYPE, "U")
.execute()
Run Code Online (Sandbox Code Playgroud)
USER导入为<jooq-generated-package>.tables.USER.
jOOQ 是否有配置属性来转义表名(所有或仅保留关键字)?我在文档或来源中找不到任何内容。
我一直在关注这个蛇的例子,并决定修改它以仅在空(即非蛇)单元格中生成新苹果。然而,这在 Observables 之间引入了循环依赖,因为现在生成新苹果不仅取决于最后一个位置,还取决于整条蛇:
// stream of last `length` positions -- snake cells
var currentSnake = currentPosition.slidingWindowBy(length);
// stream of apple positions
var apples = appleStream(currentSnake);
// length of snake
var length = apples.scan(1, function(l) { return l + 1; });
Run Code Online (Sandbox Code Playgroud)
有没有解决循环的好方法?
我可以想象这在凌乱的状态机中如何工作,但在干净的 FRP 中则不然。
我能想到的最接近的是合并apples并length成为一个流,并使该流"currentSnake"从currentPosition.
applesAndLength --> currentPosition
^ ^
| /
currentSnake
Run Code Online (Sandbox Code Playgroud)
不过,我还没有考虑太多实现。