Skip to main content

Customizing Typo

All customizations are done through the typo.Options object passed to typo:

import typo.*

val options = Options(
pkg = "org.foo",
jsonLibs = List(JsonLibName.PlayJson),
dbLib = Some(DbLibName.Anorm),
// .. more options here
)

All options

Field NameEffect
pkgSpecifies the package name for the generated code.
dbLibDefines the database library to use for code generation (anorm, doobie, zio-jdbc or None).
jsonLibsJSON libraries to generate codecs for (default is empty).
silentBannerControls whether to suppress the Typo banner while running Typo (default is false).
fileHeaderSets the header text that appears at the top of generated files.
namingConfigures naming conventions for generated code. See section below
typeOverrideDefines type overrides for specific database types See section below.
nullabilityOverrideDefines nullability overrides for specific columns See section below.
generateMockReposSpecifies which repositories to generate mock versions for (default is all).
enableFieldValueControls whether to enable FieldValue code generation for specific repositories (default is disabled).
enableStreamingInsertsControls whether to enable streaming inserts
enableTestInsertsControls whether to enable test inserts for specific repositories (default is none).
enablePrimaryKeyTypeControls whether to enable primary key types for specific repositories (default is all).
readonlyRepoSpecifies whether to generate read-only repositories for specific repositories. Useful when you're working on a part of the system where you only consume certain tables. (default is false - all mutable).
enableDslEnables the SQL DSL for code generation (default is false).
keepDependenciesSpecifies whether to generate table dependencies in generated code even if you didn't select them (default is false).
rewriteDatabaseLet's you perform arbitrary rewrites of database schema snapshot. you can add/remove rows, foreign keys and so on.

Development options

Field NameEffect
debugTypesEnables debug mode for types during code generation (default is false).
inlineImplicitsControls whether to inline implicits for generated code (default is true).
loggerSpecifies the logger to use for logging during code generation (default is console logging). Useful for