Liking cljdoc? Tell your friends :D

SQL File Layout

Bisql resolves SQL templates from the logical sql/ base path on the classpath. In practice, that usually means src/sql/ or resources/sql/.

Recommended layout:

sql/<dialect>/<schema>/<table>/<clj-function>.sql

Example:

src/sql/postgresql/public/users/get-by-id.sql

Rules and conventions:

  • postgresql is the dialect segment in the current implementation
  • public is the default schema
  • the table directory becomes part of the generated namespace
  • the file name usually matches the generated or handwritten Clojure function name

This keeps:

  • SQL files easy to find
  • generated CRUD files aligned with schema structure
  • handwritten queries and generated queries in the same shape

See also:

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close