Skip to content

Added typed columns for better CREATE SQL support#44

Merged
ez-plugins merged 5 commits intomainfrom
feature/typed-columns
Apr 22, 2026
Merged

Added typed columns for better CREATE SQL support#44
ez-plugins merged 5 commits intomainfrom
feature/typed-columns

Conversation

@ez-plugins
Copy link
Copy Markdown
Contributor

@ez-plugins ez-plugins commented Apr 22, 2026

ColumnType for type-safe column definitions

  • Add ColumnType final class with 25 fixed-type constants (TINYINT through
    UUID), 7 parameterised factory methods (varChar, charType, decimal,
    numeric, binary, varBinary, timestamp), and 4 chainable modifier methods
    (notNull, unique, autoIncrement, defaultValue)
  • Add CreateBuilder.column(String, ColumnType) overload; delegates to the
    existing column(String, String) via ColumnType.toSql(), fully backward
    compatible
  • Add ColumnTypeTest: 32 tests covering constants, factories, modifiers,
    chaining, and CreateBuilder integration

Per-type shorthand classes

Each class in the new col package wraps a single ColumnType constant or
factory method behind a concise name and a uniform of() / of(params)
factory. Developers can use a wildcard import to write:

import com.github.ezframework.javaquerybuilder.query.builder.col.*;

.column("id",         Int.of().notNull().autoIncrement())
.column("username",   VarChar.of(64).notNull().unique())
.column("price",      Decimal.of(10, 2))
.column("created_at", Timestamp.of())

instead of prefixing every type with ColumnType.

Classes added (31 total):
Fixed types: TinyInt, SmallInt, Int, BigInt, SqlFloat, SqlDouble,
Real, Bool, Text, TinyText, MediumText, LongText, Clob,
Blob, TinyBlob, MediumBlob, LongBlob, Date, Time, DateTime,
Json, Serial, BigSerial, Uuid
Parameterised types: Timestamp (overloaded of() / of(int)),
VarChar, Char, Decimal, Numeric, Binary, VarBinary

  • SqlFloat / SqlDouble / Bool named to avoid shadowing java.lang types
    when the package is wildcard-imported
  • ColTypesTest: 34 tests covering all classes and modifier chaining

- README.md: remove double blank lines before ## Features,
  ## Global and Per-Query Configuration, and ## License (MD012)
- README.md: add missing trailing newline at end of file (MD047)
- AGENTS.md: add blank lines before unordered lists (MD032)
…ateBuilder

- Add ColumnType final class with 25 fixed-type constants (TINYINT through
  UUID), 7 parameterised factory methods (varChar, charType, decimal,
  numeric, binary, varBinary, timestamp), and 4 chainable modifier methods
  (notNull, unique, autoIncrement, defaultValue)
- Add CreateBuilder.column(String, ColumnType) overload; delegates to the
  existing column(String, String) via ColumnType.toSql() — fully backward
  compatible
- Add ColumnTypeTest: 32 tests covering constants, factories, modifiers,
  chaining, and CreateBuilder integration
…reference

- Replace minimal example with full ColumnType-based table definition
- Add ColumnType section: fixed-type constant table, parameterised factory
  method table, modifier chain table, and custom-type examples
- Expand IF NOT EXISTS and composite-PK examples to use ColumnType
- Update method reference table to include column(String, ColumnType)
Each class in the new col package wraps a single ColumnType constant or
factory method behind a concise name and a uniform of() / of(params)
factory. Developers can use a wildcard import to write:

    import com.github.ezframework.javaquerybuilder.query.builder.col.*;

    .column("id",         Int.of().notNull().autoIncrement())
    .column("username",   VarChar.of(64).notNull().unique())
    .column("price",      Decimal.of(10, 2))
    .column("created_at", Timestamp.of())

instead of prefixing every type with ColumnType.

Classes added (31 total):
  Fixed types: TinyInt, SmallInt, Int, BigInt, SqlFloat, SqlDouble,
    Real, Bool, Text, TinyText, MediumText, LongText, Clob,
    Blob, TinyBlob, MediumBlob, LongBlob, Date, Time, DateTime,
    Json, Serial, BigSerial, Uuid
  Parameterised types: Timestamp (overloaded of() / of(int)),
    VarChar, Char, Decimal, Numeric, Binary, VarBinary

  - SqlFloat / SqlDouble / Bool named to avoid shadowing java.lang types
    when the package is wildcard-imported
  - ColTypesTest: 34 tests covering all classes and modifier chaining
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

- Add spaces to all table separator rows (|---|---| → | --- | --- |)
  across all 19 docs files to satisfy markdownlint MD060 compact style
- Remove orphan duplicate row at end of docs/queries/create.md
@ez-plugins ez-plugins merged commit 28ad3d5 into main Apr 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant