From 6cdb5e787a9b004e385fd2295fe53111159f38a4 Mon Sep 17 00:00:00 2001 From: Dmitri Date: Sat, 11 Apr 2026 23:39:55 +0200 Subject: [PATCH] jooq --- .gitignore | 4 + Dockerfile | 2 +- .../kanopo/rhythm/jooq/DefaultCatalog.java | 54 ++++ .../jooq/dev/kanopo/rhythm/jooq/Keys.java | 29 ++ .../jooq/dev/kanopo/rhythm/jooq/Public.java | 54 ++++ .../jooq/dev/kanopo/rhythm/jooq/Tables.java | 20 ++ .../dev/kanopo/rhythm/jooq/tables/Users.java | 247 ++++++++++++++++++ .../jooq/tables/records/UsersRecord.java | 127 +++++++++ 8 files changed, 536 insertions(+), 1 deletion(-) create mode 100644 target/generated-sources/jooq/dev/kanopo/rhythm/jooq/DefaultCatalog.java create mode 100644 target/generated-sources/jooq/dev/kanopo/rhythm/jooq/Keys.java create mode 100644 target/generated-sources/jooq/dev/kanopo/rhythm/jooq/Public.java create mode 100644 target/generated-sources/jooq/dev/kanopo/rhythm/jooq/Tables.java create mode 100644 target/generated-sources/jooq/dev/kanopo/rhythm/jooq/tables/Users.java create mode 100644 target/generated-sources/jooq/dev/kanopo/rhythm/jooq/tables/records/UsersRecord.java diff --git a/.gitignore b/.gitignore index 26fdcde..ebe15f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ HELP.md +# Track jOOQ generated sources +!target/generated-sources/jooq/ target/ .mvn/wrapper/maven-wrapper.jar !**/src/main/**/target/ @@ -32,3 +34,5 @@ build/ ### VS Code ### .vscode/ .env + + diff --git a/Dockerfile b/Dockerfile index b9e0202..34d9428 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN ./mvnw dependency:go-offline COPY src ./src # Build the application JAR using the Maven Wrapper -RUN ./mvnw clean package -DskipTests +RUN ./mvnw clean package -DskipTests -Djooq.codegen.skip=true -Dflyway.skip=true # ---- STAGE 2: Runtime ---- diff --git a/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/DefaultCatalog.java b/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/DefaultCatalog.java new file mode 100644 index 0000000..07a2abf --- /dev/null +++ b/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/DefaultCatalog.java @@ -0,0 +1,54 @@ +/* + * This file is generated by jOOQ. + */ +package dev.kanopo.rhythm.jooq; + + +import java.util.Arrays; +import java.util.List; + +import org.jooq.Constants; +import org.jooq.Schema; +import org.jooq.impl.CatalogImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class DefaultCatalog extends CatalogImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of DEFAULT_CATALOG + */ + public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); + + /** + * The schema public. + */ + public final Public PUBLIC = Public.PUBLIC; + + /** + * No further instances allowed + */ + private DefaultCatalog() { + super(""); + } + + @Override + public final List getSchemas() { + return Arrays.asList( + Public.PUBLIC + ); + } + + /** + * A reference to the 3.19 minor release of the code generator. If this + * doesn't compile, it's because the runtime library uses an older minor + * release, namely: 3.19. You can turn off the generation of this reference + * by specifying /configuration/generator/generate/jooqVersionReference + */ + private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_19; +} diff --git a/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/Keys.java b/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/Keys.java new file mode 100644 index 0000000..4e55dd2 --- /dev/null +++ b/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/Keys.java @@ -0,0 +1,29 @@ +/* + * This file is generated by jOOQ. + */ +package dev.kanopo.rhythm.jooq; + + +import dev.kanopo.rhythm.jooq.tables.Users; +import dev.kanopo.rhythm.jooq.tables.records.UsersRecord; + +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.Internal; + + +/** + * A class modelling foreign key relationships and constraints of tables in + * public. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Keys { + + // ------------------------------------------------------------------------- + // UNIQUE and PRIMARY KEY definitions + // ------------------------------------------------------------------------- + + public static final UniqueKey USERS_EMAIL_KEY = Internal.createUniqueKey(Users.USERS, DSL.name("users_email_key"), new TableField[] { Users.USERS.EMAIL }, true); + public static final UniqueKey USERS_PKEY = Internal.createUniqueKey(Users.USERS, DSL.name("users_pkey"), new TableField[] { Users.USERS.ID }, true); +} diff --git a/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/Public.java b/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/Public.java new file mode 100644 index 0000000..71bc55f --- /dev/null +++ b/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/Public.java @@ -0,0 +1,54 @@ +/* + * This file is generated by jOOQ. + */ +package dev.kanopo.rhythm.jooq; + + +import dev.kanopo.rhythm.jooq.tables.Users; + +import java.util.Arrays; +import java.util.List; + +import org.jooq.Catalog; +import org.jooq.Table; +import org.jooq.impl.SchemaImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Public extends SchemaImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public + */ + public static final Public PUBLIC = new Public(); + + /** + * The table public.users. + */ + public final Users USERS = Users.USERS; + + /** + * No further instances allowed + */ + private Public() { + super("public", null); + } + + + @Override + public Catalog getCatalog() { + return DefaultCatalog.DEFAULT_CATALOG; + } + + @Override + public final List> getTables() { + return Arrays.asList( + Users.USERS + ); + } +} diff --git a/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/Tables.java b/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/Tables.java new file mode 100644 index 0000000..10d0c1e --- /dev/null +++ b/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/Tables.java @@ -0,0 +1,20 @@ +/* + * This file is generated by jOOQ. + */ +package dev.kanopo.rhythm.jooq; + + +import dev.kanopo.rhythm.jooq.tables.Users; + + +/** + * Convenience access to all tables in public. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Tables { + + /** + * The table public.users. + */ + public static final Users USERS = Users.USERS; +} diff --git a/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/tables/Users.java b/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/tables/Users.java new file mode 100644 index 0000000..1175478 --- /dev/null +++ b/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/tables/Users.java @@ -0,0 +1,247 @@ +/* + * This file is generated by jOOQ. + */ +package dev.kanopo.rhythm.jooq.tables; + + +import dev.kanopo.rhythm.jooq.Keys; +import dev.kanopo.rhythm.jooq.Public; +import dev.kanopo.rhythm.jooq.tables.records.UsersRecord; + +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Users extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.users + */ + public static final Users USERS = new Users(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return UsersRecord.class; + } + + /** + * The column public.users.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("gen_random_uuid()"), SQLDataType.UUID)), this, ""); + + /** + * The column public.users.email. + */ + public final TableField EMAIL = createField(DSL.name("email"), SQLDataType.VARCHAR(255).nullable(false), this, ""); + + /** + * The column public.users.password. + */ + public final TableField PASSWORD = createField(DSL.name("password"), SQLDataType.VARCHAR(255), this, ""); + + /** + * The column public.users.created_at. + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); + + /** + * The column public.users.updated_at. + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); + + private Users(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private Users(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); + } + + /** + * Create an aliased public.users table reference + */ + public Users(String alias) { + this(DSL.name(alias), USERS); + } + + /** + * Create an aliased public.users table reference + */ + public Users(Name alias) { + this(alias, USERS); + } + + /** + * Create a public.users table reference + */ + public Users() { + this(DSL.name("users"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.USERS_PKEY; + } + + @Override + public List> getUniqueKeys() { + return Arrays.asList(Keys.USERS_EMAIL_KEY); + } + + @Override + public Users as(String alias) { + return new Users(DSL.name(alias), this); + } + + @Override + public Users as(Name alias) { + return new Users(alias, this); + } + + @Override + public Users as(Table alias) { + return new Users(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Users rename(String name) { + return new Users(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Users rename(Name name) { + return new Users(name, null); + } + + /** + * Rename this table + */ + @Override + public Users rename(Table name) { + return new Users(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Users where(Condition condition) { + return new Users(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Users where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Users where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Users where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Users where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Users where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Users where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Users where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Users whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Users whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/tables/records/UsersRecord.java b/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/tables/records/UsersRecord.java new file mode 100644 index 0000000..cf7bc02 --- /dev/null +++ b/target/generated-sources/jooq/dev/kanopo/rhythm/jooq/tables/records/UsersRecord.java @@ -0,0 +1,127 @@ +/* + * This file is generated by jOOQ. + */ +package dev.kanopo.rhythm.jooq.tables.records; + + +import dev.kanopo.rhythm.jooq.tables.Users; + +import java.time.OffsetDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class UsersRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.users.id. + */ + public void setId(UUID value) { + set(0, value); + } + + /** + * Getter for public.users.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.users.email. + */ + public void setEmail(String value) { + set(1, value); + } + + /** + * Getter for public.users.email. + */ + public String getEmail() { + return (String) get(1); + } + + /** + * Setter for public.users.password. + */ + public void setPassword(String value) { + set(2, value); + } + + /** + * Getter for public.users.password. + */ + public String getPassword() { + return (String) get(2); + } + + /** + * Setter for public.users.created_at. + */ + public void setCreatedAt(OffsetDateTime value) { + set(3, value); + } + + /** + * Getter for public.users.created_at. + */ + public OffsetDateTime getCreatedAt() { + return (OffsetDateTime) get(3); + } + + /** + * Setter for public.users.updated_at. + */ + public void setUpdatedAt(OffsetDateTime value) { + set(4, value); + } + + /** + * Getter for public.users.updated_at. + */ + public OffsetDateTime getUpdatedAt() { + return (OffsetDateTime) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached UsersRecord + */ + public UsersRecord() { + super(Users.USERS); + } + + /** + * Create a detached, initialised UsersRecord + */ + public UsersRecord(UUID id, String email, String password, OffsetDateTime createdAt, OffsetDateTime updatedAt) { + super(Users.USERS); + + setId(id); + setEmail(email); + setPassword(password); + setCreatedAt(createdAt); + setUpdatedAt(updatedAt); + resetChangedOnNotNull(); + } +}