Reputation: 4327
I'm using jooq in a scala play framework app, I have changed from mariadb to postgre 9.5.3 and i'm trying to generate the model classes for jooq but I receive an error during generation.
In my generator settings I have the same settings as in the application.conf, the strange thing is that the app starts normally and the hikari connection pool is created successfully, but the jooq generator says that cann not access the schema.
The log from play console which shows that the connection works:
[info] 2017-02-27 22:12:25,670 application - Creating Pool for datasource 'default'
[info] 2017-02-27 22:12:26,156 p.a.d.DefaultDBApi - Database [default] connected at jdbc:postgresql://localhost:5432/footballgladiator
[info] 2017-02-27 22:12:26,377 application - ApplicationTimer demo: Starting application at 2017-02-27T21:12:26.356Z.
[info] 2017-02-27 22:12:27,501 play.api.Play - Application started (Dev)
The applicatoin.conf db settings:
default.driver = org.postgresql.Driver
default.url = "jdbc:postgresql://localhost:5432/footballgladiator"
default.username = postgres
default.password = admin
default.maximumPoolSize=9
The jook generator file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.7.0.xsd">
<jdbc>
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://localhost:5432/footballgladiator</url>
<user>postgres</user>
<password>admin</password>
</jdbc>
<generator>
<name>org.jooq.util.ScalaGenerator</name>
<database>
<name>org.jooq.util.postgres.PostgresDatabase</name>
<inputSchema>footballgladiator</inputSchema>
<includes>.*</includes>
<excludes></excludes>
</database>
<target>
<packageName>generated</packageName>
<directory>app</directory>
</target>
</generator>
</configuration>
The generator error:
[debug] 2017-02-27 22:06:52,882 o.j.t.LoggerListener - Executing query : select "pg_catalog"."pg_namespace"."nspname" from "pg_catalog"."pg_namespace"
[debug] 2017-02-27 22:06:52,952 o.j.t.StopWatch - Query executed : Total: 92.925ms
[debug] 2017-02-27 22:06:53,152 o.j.t.LoggerListener - Fetched result : +---------------+
[debug] 2017-02-27 22:06:53,152 o.j.t.LoggerListener - : |nspname |
[debug] 2017-02-27 22:06:53,152 o.j.t.LoggerListener - : +---------------+
[debug] 2017-02-27 22:06:53,152 o.j.t.LoggerListener - : |pg_toast |
[debug] 2017-02-27 22:06:53,152 o.j.t.LoggerListener - : |pg_temp_1 |
[debug] 2017-02-27 22:06:53,152 o.j.t.LoggerListener - : |pg_toast_temp_1|
[debug] 2017-02-27 22:06:53,152 o.j.t.LoggerListener - : |pg_catalog |
[debug] 2017-02-27 22:06:53,152 o.j.t.LoggerListener - : |public |
[debug] 2017-02-27 22:06:53,152 o.j.t.LoggerListener - : +---------------+
[debug] 2017-02-27 22:06:53,152 o.j.t.LoggerListener - : |...1 record(s) truncated...
[debug] 2017-02-27 22:06:53,153 o.j.t.StopWatch - Finishing : Total: 293.304ms, +200.378ms
[warn] 2017-02-27 22:06:53,155 o.j.u.AbstractDatabase - No schemata were loaded : Please check your connection settings, and whether your database (and your database version!) is re
ally supported by jOOQ. Also, check the case-sensitivity in your configured <inputSchema/> elements : [footballgladiator]
Upvotes: 1
Views: 223
Reputation: 4327
ahh I found it out, the inputSchema is named public not footbalgladiator which was my database, postgres has a schema named public where you have your databases in so the generator settings should be
<database>
<name>org.jooq.util.postgres.PostgresDatabase</name>
<inputSchema>public</inputSchema>
<includes>.*</includes>
<excludes></excludes>
</database>
Upvotes: 2