Skip to content

Reorganize repo#172

Merged
oyvindberg merged 21 commits intomainfrom
reorganize-testers-fixed
Dec 25, 2025
Merged

Reorganize repo#172
oyvindberg merged 21 commits intomainfrom
reorganize-testers-fixed

Conversation

@oyvindberg
Copy link
Copy Markdown
Collaborator

Summary

Major reorganization of the Typr codebase with module renames, folder restructuring, documentation improvements, and API generalizations.

Changes

1. Tester Project Reorganization

  • Move all tester projects into testers/ folder with {database}/{language}/ structure
  • Reduces clutter at repository root

2. Code Generation Optimization

  • Reduce AdventureWorks generation from ~177 tables to ~35 actually used by tests
  • Remove GenHardcodedFiles source generator (no longer needed)

3. Module Renames

  • typr-runtime-javafoundations-jdbc
  • typr-dsl-javafoundations-jdbc-dsl
  • typr-dsl-kotlinfoundations-jdbc-dsl-kotlin
  • typr-dsl-scalafoundations-jdbc-dsl-scala
  • Package: typr.*dev.typr.foundations.*

4. Documentation

  • Add comprehensive Foundations JDBC docs to website (site/docs-jdbc/)
  • Database-specific type documentation (PostgreSQL, MariaDB, DuckDB, Oracle, SQL Server)
  • JSON parsing examples for MULTISET-like queries

5. CLAUDE.md Overhaul

  • Rename Typo → Typr
  • Document multi-language support (Java, Kotlin, Scala)
  • Document multi-database support (PostgreSQL, MariaDB, DuckDB, Oracle, SQL Server)
  • Add Docker-compose setup details
  • Mark Anorm/Doobie/ZIO-JDBC as legacy (PostgreSQL+Scala only)

6. API Generalizations

  • Add Mapped record to all *Read interfaces
  • Remove KotlinNullable*Read classes
  • Generalize DbType.nullable() for Kotlin/Scala
  • paramNullable() and UpdateBuilder.set() now accept DbType instead of PgType

Test plan

  • All Kotlin tests pass (PostgreSQL, MariaDB)
  • All Java tests pass (PostgreSQL)
  • All Scala tests pass (MariaDB)
  • Code compiles across all modules

🤖 Generated with Claude Code

oyvindberg and others added 21 commits December 24, 2025 22:21
Move all tester projects under a unified testers/ folder with database
and language-based organization:
- testers/pg/scala/{anorm,doobie,zio-jdbc,scalatypes,javatypes}
- testers/{duckdb,mariadb,oracle,sqlserver}/{java,kotlin,scala}
- testers/openapi/{java,kotlin,scala}/{jaxrs,spring,quarkus,http4s}

Renamed scala-new/scala-old to scalatypes/javatypes for clarity.
Updated bleep.yaml, settings.gradle.kts, .scalafmt.conf, and CI workflow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The project name matching for Java vs Scala detection needed to be updated
to handle both old naming (typr-java) and new naming (testers/pg/java).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Analyzes test file usage and limits code generation to only the ~35
tables actually referenced by tests, down from ~177 tables.

This dramatically reduces compile time for the testers/pg projects.

Changes:
- Add selector in GeneratedAdventureWorks.scala that filters to only used tables
- Update folder paths from old naming (typr-tester-*) to new (testers/pg/*)
- Remove unused domain overrides (AccountNumber, Phone, OrderNumber) from DomainInsert files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The hardcoded file generator is no longer needed since GeneratedAdventureWorks
now handles all code generation for tester projects.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Comprehensive rewrite reflecting current project state:
- Rename from Typo to Typr
- Document support for Scala, Java, and Kotlin languages
- Document support for PostgreSQL, MariaDB, DuckDB, SQL Server, Oracle
- Add tester project layout (generated-and-checked-in vs src folders)
- Add Docker-compose database setup with initialization details
- Add DSL architecture section (Java core with Scala/Kotlin wrappers)
- Mark Anorm/Doobie/ZIO-JDBC as legacy (PostgreSQL+Scala only)
- Document SQL file locations (schema files vs query files)
- Update all bleep commands to current script names

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Module renames:
- typr-runtime-java → foundations-jdbc
- typr-dsl-java → foundations-jdbc-dsl
- typr-dsl-kotlin → foundations-jdbc-dsl-kotlin
- typr-dsl-scala → foundations-jdbc-dsl-scala

Package restructuring:
- Modern DSL (DbLibTypo): typr.* → dev.typr.foundations.*
- Legacy DSL (Anorm/Doobie/ZioJdbc): keep using typr.dsl via DslQualifiedNames.Legacy

Other changes:
- Update Gradle settings and build files for new module names
- Add Kotlin variant to GeneratedAdventureWorks
- Regenerate all tester projects with new package structure
- Remove stale typr-tester-mariadb-* directories

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- typr-runtime-java → foundations-jdbc
- typr-dsl-java → foundations-jdbc-dsl
- typr-dsl-kotlin → foundations-jdbc-dsl-kotlin
- typr-dsl-scala → foundations-jdbc-dsl-scala

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document the standalone JDBC wrapper library:
- JDBC's problems with type handling and correctness
- Full roundtrip support for all column types across 5 databases
- Type-safe database types (PgType, MariaType, etc.)
- JSON codecs for cross-database MULTISET functionality
- Streaming inserts for bulk operations
- No reflection (GraalVM native-image compatible)
- Native Kotlin/Scala type wrappers
- Fragment builder for type-safe SQL construction

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create site/docs-jdbc/ with comprehensive library documentation
- Add sidebars-jdbc.js for navigation
- Update docusaurus.config.js with jdbc plugin, navbar and footer items
- Simplify CLAUDE.md to point to site docs

Documentation covers:
- JDBC pain points and our type-safe solution
- Supported databases (PostgreSQL, MariaDB, DuckDB, Oracle, SQL Server)
- Type-safe database types with language tabs (Java/Kotlin/Scala)
- Row parsers and result set parsers
- SQL fragment builder and interpolation
- Clear error messages
- JSON codecs for MULTISET functionality
- Streaming inserts
- No reflection (GraalVM native-image compatible)
- Native Kotlin and Scala type support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Java: Person::new instead of lambda
- Kotlin: ::Person constructor reference
- Scala: Person.apply instead of lambda
- Update Scala string interpolation to use actual sql interpolator

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix JSON Codecs section: use actual DbJson/JsonValue approach
- Fix Native Types section: remove incorrect row.get examples
- Add separate database type pages with comprehensive coverage:
  - PostgreSQL: arrays, ranges, geometric, network, JSON, text search
  - MariaDB/MySQL: unsigned integers, spatial types, sets, JSON
  - DuckDB: lists, structs, maps, 128-bit integers, enums
  - Oracle: OBJECT types, nested tables, intervals, LOBs
  - SQL Server: geography, geometry, hierarchyid, Unicode types
- Update sidebar with Database Types category
- Use constructor references in examples (Person::new)
- Use actual Scala sql interpolator with Fragment.encode

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Escape < and ≤ characters as HTML entities to avoid MDX
parsing them as JSX tags.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove category wrapper to show databases directly in sidebar.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Show how to use RowParser.parseJsonArray() to parse nested
query results returned as JSON, enabling MULTISET-like queries
across all databases.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Show the intended API where RowParser.jsonListType() creates
a DbType<List<Row>> that encapsulates JSON array parsing,
making it composable with other DbTypes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Mapped record to all *Read interfaces (PgRead, MariaRead, DuckDbRead,
  SqlServerRead, OracleRead) for proper null handling after map operations
- Remove KotlinNullable*Read classes - no longer needed with Mapped approach
- Simplify RowParser.opt() to always wrap columns with .opt() instead of
  detecting already-nullable types
- Generalize Kotlin/Scala nullable extensions to use generic DbType instead
  of database-specific types (PgType, MariaType, etc.)
- Remove database-specific TypeOps classes from Scala RuntimeExtensions,
  keeping only generic DbTypeOps

Use DbType instead of PgType in Kotlin/Scala DSL wrappers

- paramNullable() now accepts DbType instead of PgType
- UpdateBuilder.set() now accepts DbType instead of PgType

These methods work with any database type, not just PostgreSQL.
Remove references to AccountNumber, Phone, and OrderNumber domains
that no longer exist after reducing generated tables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add shift, employeedepartmenthistory, vemployee tables to usedTables
- Fix testing-with-random-values.md to use only existing domain types
- Remove references to publicAccountNumber, publicPhone, publicOrderNumber

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove references to publicAccountNumber, publicPhone, publicOrderNumber
which no longer exist after reducing generated tables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add concurrency group to cancel in-progress builds when new commit pushed
- Change postgres matrix fail-fast to true

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@oyvindberg oyvindberg merged commit 671ec8f into main Dec 25, 2025
12 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