One DBAdapter implementation, over a per-engine spec.
There used to be four, and they were copies: each query.clj was the same
sixty lines turning on two decisions, and each core.clj was thirty lines of
delegation. A fix landed in one and not its neighbours — that is how H2 came
to carry a table-exists? workaround while SQLite and MySQL reported every
table as absent (BOU-430).
A spec names what the port says may differ between engines, and nothing else:
:label for log lines — "MySQL" :dialect what callers dispatch on; nil means PostgreSQL :driver JDBC driver class name :jdbc-url (fn [db-config] -> String) :pool HikariCP defaults :session-statements (fn [db-config] -> seq of JDBC param vectors) :booleans :native or :int :string-match :like or :ilike :table-exists? (fn [datasource table-name] -> boolean) :table-info (fn [datasource table-name] -> vector of column maps)
One `DBAdapter` implementation, over a per-engine spec. There used to be four, and they were copies: each `query.clj` was the same sixty lines turning on two decisions, and each `core.clj` was thirty lines of delegation. A fix landed in one and not its neighbours — that is how H2 came to carry a `table-exists?` workaround while SQLite and MySQL reported every table as absent (BOU-430). A spec names what the port says may differ between engines, and nothing else: :label for log lines — "MySQL" :dialect what callers dispatch on; nil means PostgreSQL :driver JDBC driver class name :jdbc-url (fn [db-config] -> String) :pool HikariCP defaults :session-statements (fn [db-config] -> seq of JDBC param vectors) :booleans :native or :int :string-match :like or :ilike :table-exists? (fn [datasource table-name] -> boolean) :table-info (fn [datasource table-name] -> vector of column maps)
Common connection pool management utilities.
Common connection pool management utilities.
Common database operations - main coordination module.
This namespace serves as the main coordinator for common database functionality, bringing together specialized modules for different aspects of database operations that work across all adapter types.
The common functionality has been refactored into specialized namespaces:
Pure query building functions are now in wagoe.platform.core.database.query
This modular structure provides:
Common database operations - main coordination module. This namespace serves as the main coordinator for common database functionality, bringing together specialized modules for different aspects of database operations that work across all adapter types. The common functionality has been refactored into specialized namespaces: - common.connection: Connection pool management with HikariCP - common.execution: Query execution with logging and error handling - common.schema: Schema introspection and DDL execution - common.utils: Database information and convenience functions - common.core: Main coordination module (this namespace) Pure query building functions are now in wagoe.platform.core.database.query This modular structure provides: - Better organization with focused responsibilities - Easier maintenance and testing - Consistent patterns across all database adapters - Clear separation of concerns
Query execution with I/O, logging, and error handling.
This is part of the imperative shell - it performs database I/O, manages transactions, and handles side effects like logging.
Query execution with I/O, logging, and error handling. This is part of the imperative shell - it performs database I/O, manages transactions, and handles side effects like logging.
Table introspection for every adapter.
PostgreSQL, MySQL and H2 all read information_schema and differ only in
which schema predicate identifies "this database", which HoneySQL dialect
formats the query, and whether the table name may be folded to lower case.
SQLite has no information_schema and reads sqlite_master and
PRAGMA table_info instead.
Both forms return the same column maps — :name (lower case), :type,
:not-null, :default, :primary-key — which is what the port promises
and what the four separate copies did not consistently deliver.
Table introspection for every adapter. PostgreSQL, MySQL and H2 all read `information_schema` and differ only in which schema predicate identifies "this database", which HoneySQL dialect formats the query, and whether the table name may be folded to lower case. SQLite has no `information_schema` and reads `sqlite_master` and `PRAGMA table_info` instead. Both forms return the same column maps — `:name` (lower case), `:type`, `:not-null`, `:default`, `:primary-key` — which is what the port promises and what the four separate copies did not consistently deliver.
Common schema management and DDL utilities.
Common schema management and DDL utilities.
Common database utilities and information functions.
Common database utilities and information functions.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |