Configuration

Most projects configure almost nothing. YoSQL works the rest out from your SQL, your schema and the records you already have, and every setting below defaults to what the majority of projects would have picked anyway.

So start with an empty configuration, write a statement, and come back here when something is not where YoSQL looked for it.

What a project usually sets

Four, and a project on the conventional Maven or Gradle layout sets one:

SettingWhat it answers
basePackageNameWhich package the generated repositories live in.
inputBaseDirectoryWhere the .sql files are, if not src/main/yosql.
sourceDirectoryWhere the records a statement names are, if not src/main/java.
validationWhether a statement disagreeing with your schema warns or stops the build.

What a statement says

Configuration belonging to one query rather than to the project goes in that statement’s front matter , and most statements need three lines of it:

-- name: findTenant
-- returning: single
-- resultRowType: com.example.domain.Tenant
select id, slug, created_at from tenant where id = :id

name , returning and resultRowType carry almost every statement. parameters is needed only where neither the schema nor the result row type says what a parameter holds, vendor only where a statement is written once per database, and repository only where a statement belongs somewhere other than its directory suggests.

Everything else

The remaining groups are worth reading when you need them, and not before: