简体   繁体   English

在 Spring Boot 中运行 r2dbc 时获取 H2 时出错

[英]Error getting H2 with r2dbc running in Spring boot

for days now I've been trying to get a simple H2 / R2dbc database running in Spring boot with WebFlux.几天来,我一直在尝试使用 WebFlux 在 Spring Boot 中运行一个简单的 H2/R2dbc 数据库。 The app starts up just fine but when I call the /todos endpoint to get all the objects in the database I get the following error:该应用程序启动得很好,但是当我调用 /todos 端点以获取数据库中的所有对象时,出现以下错误:

reactor.core.Exceptions$ErrorCallbackNotImplemented: org.springframework.data.r2dbc.BadSqlGrammarException: executeMany; bad SQL grammar [SELECT TODO.* FROM TODO]; nested exception is io.r2dbc.spi.R2dbcBadGrammarException: [42102] [42S02] Table "TODO" not found; SQL statement:
SELECT TODO.* FROM TODO [42102-200]

My understanding is that if I add a schema.sql file on the class path with a create table command it will use that to create the table on startup, but it does not look like that is working.我的理解是,如果我使用 create table 命令在类路径上添加一个 schema.sql 文件,它将在启动时使用它来创建表,但它看起来不起作用。 Any ideas on what I may be doing wrong?关于我可能做错了什么的任何想法? Any help would be appreciated, what would like to get to is a working mysql/r2dbc example, if someone could point me to one.任何帮助将不胜感激,如果有人能指点我,想要得到的是一个有效的 mysql/r2dbc 示例。

All the code is located at: https://gitlab.com/vanfleet/test-r2dbc-h2所有代码位于: https : //gitlab.com/vanfleet/test-r2dbc-h2

It is query issue.是查询问题。 Run same query in editor.在编辑器中运行相同的查询。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM