Blackdread/sql-to-jdl

Missing files

palaciosdiego opened this issue · 22 comments

Hi some errors that i get, i could not find the jooq folder in the repo.

import static org.blackdread.sqltojava.jooq.InformationSchema.INFORMATION_SCHEMA;
import static org.blackdread.sqltojava.jooq.tables.KeyColumnUsage.KEY_COLUMN_USAGE;

regards.

same issue, please up them.
regards.

to dpalaciosarriaga

i got it, before mvn installing, you must set the part of database url in pom.xml.
enjoy!

Yes indeed :)
I will add later in readme that pom.xml might need to be changed.
But the default url should work if you have wampserver running for example.

There is also the application.yml of course to set as well

Hello, I got the same issue.
image

  1. See jOOQ doc for code generation

  2. Make sure to have the mysql db running otherwise jooq cannot generate these two classes

  3. these classes are generated code so you need to do "mvn compile" at least once before running the main

Thanks, MySql is running and files are genereted except for InformationSchema and KeyColumnUsage
image

image

give your pom.xml, you must have changed it, this issue is very basic.
Default pom.xml I provide is supposed to generate the information schema with everything needed to generate the jdl file:


                <generator>
                        <name>org.jooq.util.DefaultGenerator</name>
                        <database>
                            <name>org.jooq.util.mysql.MySQLDatabase</name>
                            <includes>.*</includes>
                            <excludes></excludes>
                            <!--<inputSchema></inputSchema>--> <!-- This will generate all schema of db, better to only generate the one interested in -->
                            <inputSchema>information_schema</inputSchema>
                        </database>
                        <target>
                            <packageName>org.blackdread.sqltojava.jooq</packageName>
                            <directory>target/generated-sources/jooq</directory>
                        </target>
                </generator>

Thank you so much.
I found my mistake.
<database.url>jdbc:mysql://localhost:3306/DatabaseName</database.url>
I shoud not added the database name to connection String.

Do not change (only eventually port and localhost):

  • POM:
    <database.url>jdbc:mysql://localhost:3306/</database.url>

  • properties:
    url: jdbc:mysql://localhost:3306/?useUnicode=true&characterEncoding=utf8&useSSL=false

Most users will only change:

application:
    table-to-export: my_schema
    ignored-table-names:
        - databasechangelog
        - databasechangeloglock
    export:
        path: ./my-project-jdl.jh
type: jdl
  1. See jOOQ doc for code generation
  2. Make sure to have the mysql db running otherwise jooq cannot generate these two classes
  3. these classes are generated code so you need to do "mvn compile" at least once before running the main

i tried to go mvn compile and i got this

A required class was missing while executing org.jooq:jooq-codegen-maven:3.10.5:generate: javax/xml/bind/JAXB

Can you provide your configuration?
Also provide a screenshot of phpMyAdmin of dbs you have.

For example, for me property "table-to-export" would be "auto" which is db I want to export to JDL.
image

I just pulled this project and was able to compile the project.
I also restarted a build with travis, no errors.

Just make sure you have your db ON (wampserver for example), same port, the property "table-to-export" with name of schema to export -> name of db

Important
javax/xml/bind/JAXB has been removed, please use Java 8 for compile and runtime.

Hello @Blackdread I'm currently working on Mac so I don't have PHPMyAdmin running but I have a sql server running and I'm using MAMP as a server, any suggestions ?

Do not change (only eventually port and localhost):

  • POM:
    <database.url>jdbc:mysql://localhost:3306/</database.url>
  • properties:
    url: jdbc:mysql://localhost:3306/?useUnicode=true&characterEncoding=utf8&useSSL=false

Most users will only change:

application:
    table-to-export: my_schema
    ignored-table-names:
        - databasechangelog
        - databasechangeloglock
    export:
        path: ./my-project-jdl.jh
type: jdl

Hello

I ran 'mvn compile' but no jdl was generated from sql. Please do I need to run ant additional command?

what is your config?

what is your config?
application.yml

spring:
    datasource:
            type: com.zaxxer.hikari.HikariDataSource
            url: jdbc:mysql://localhost:3306/?useUnicode=true&characterEncoding=utf8&useSSL=false
            username: root
            password: MyPassword
            hikari:
                data-source-properties:
                    cachePrepStmts: true
                    prepStmtCacheSize: 250
                    prepStmtCacheSqlLimit: 2048
                    useServerPrepStmts: true
    jooq:
        sql-dialect: mysql


application:
    table-to-export: my-database
    ignored-table-names:
        - databasechangelog
        - databasechangeloglock
    export:
        path: ./my-project-jdl.jh
        type: jdl


pom.xml


<database.url>jdbc:mysql://localhost:3306/my-database?useLegacyDatetimeCode=false&amp;serverTimezone=UTC</database.url>

                     <jdbc>
                        <driver>com.mysql.cj.jdbc.Driver</driver>
                        <url>${database.url}</url>
                        <user>root</user>
                        <password>MyPassword</password>
                    </jdbc

I noticed that application.yml is overwritten any time I run "mvn compile".

Thanks

do not change jdbc:mysql://localhost:3306/my-database

do not change jdbc:mysql://localhost:3306/my-database
application.yml
Where do locate the jdl output that is generated? I can see it anywhere.
Is this okay. This is 100% generated.

 application.yml
spring:
    datasource:
            type: com.zaxxer.hikari.HikariDataSource
            url: jdbc:mysql://localhost:3306/?useUnicode=true&characterEncoding=utf8&useSSL=false
            username: root
            password:
            hikari:
                data-source-properties:
                    cachePrepStmts: true
                    prepStmtCacheSize: 250
                    prepStmtCacheSqlLimit: 2048
                    useServerPrepStmts: true
    jooq:
        sql-dialect: mysql


application:
    table-to-export: my_schema
    ignored-table-names:
        - databasechangelog
        - databasechangeloglock
    export:
        path: ./my-project-jdl.jh
        type: jdl`

@sreerajr137 create another issue

Hello , i really want steps to run this project .. what are jooq and mysql version you're using .. and what are the config to change exactly .. thank you

use "mvn compile" or "mvnw compile", with db ON.
Then read full issue for any other build issue

is it possible to connect with a sqlserver database

See Readme or #52
Need to impl few changes to support it