Liking cljdoc? Tell your friends :D

wagoe.platform.shell.adapters.database.integration-example

Example integration showing how to use the multi-database adapter system.

This namespace demonstrates how to:

  • Load environment-specific configurations
  • Initialize database adapters based on active configurations
  • Use the initialized adapters for database operations
  • Handle multiple active databases simultaneously
Example integration showing how to use the multi-database adapter system.

This namespace demonstrates how to:
- Load environment-specific configurations
- Initialize database adapters based on active configurations
- Use the initialized adapters for database operations
- Handle multiple active databases simultaneously
raw docstring

current-stateclj

(current-state)

Get current application state - useful for debugging.

Get current application state - useful for debugging.
sourceraw docstring

example-basic-usageclj

(example-basic-usage)

Demonstrate basic usage of the multi-database system.

Demonstrate basic usage of the multi-database system.
sourceraw docstring

example-environment-switchingclj

(example-environment-switching)

Demonstrate switching between different environment configurations.

Demonstrate switching between different environment configurations.
sourceraw docstring

execute-queryclj

(execute-query adapter-key query-map)

Execute a query on a specific database adapter.

Args: adapter-key - Keyword identifying the adapter query-map - HoneySQL query map

Returns: Query results or throws exception

Execute a query on a specific database adapter.

Args:
  adapter-key - Keyword identifying the adapter
  query-map - HoneySQL query map

Returns: Query results or throws exception
sourceraw docstring

get-databaseclj

(get-database adapter-key)

Get a specific database adapter by key.

Args: adapter-key - Keyword identifying the adapter (e.g., :wagoe/sqlite)

Returns: {:adapter adapter-config :pool connection-pool} or nil

Get a specific database adapter by key.

Args:
  adapter-key - Keyword identifying the adapter (e.g., :wagoe/sqlite)

Returns: {:adapter adapter-config :pool connection-pool} or nil
sourceraw docstring

get-primary-databaseclj

(get-primary-database)

Get the primary database (first active adapter).

Useful when you have a single active database or want a default.

Get the primary database (first active adapter).

Useful when you have a single active database or want a default.
sourceraw docstring

initialize-databases!clj

(initialize-databases!)
(initialize-databases! environment)

Initialize all active databases based on the current environment configuration.

This function:

  1. Loads the environment-specific config.edn
  2. Identifies active database adapters
  3. Loads required JDBC drivers based on active databases
  4. Creates connection pools for each active adapter
  5. Stores the initialized adapters in application state

Returns: map of {:adapter-key {:adapter adapter :pool pool}}

Initialize all active databases based on the current environment configuration.

This function:
1. Loads the environment-specific config.edn
2. Identifies active database adapters
3. Loads required JDBC drivers based on active databases
4. Creates connection pools for each active adapter
5. Stores the initialized adapters in application state

Returns: map of {:adapter-key {:adapter adapter :pool pool}}
sourceraw docstring

list-active-databasesclj

(list-active-databases)

List all currently active database adapters.

Returns: sequence of [adapter-key {:adapter ... :pool ...}]

List all currently active database adapters.

Returns: sequence of [adapter-key {:adapter ... :pool ...}]
sourceraw docstring

reset-application-state!clj

(reset-application-state!)

Reset application state - useful for development and testing.

Reset application state - useful for development and testing.
sourceraw docstring

shutdown-databases!clj

(shutdown-databases!)

Safely shutdown all active database connections.

Safely shutdown all active database connections.
sourceraw docstring

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