Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hden/duct.database.datomic
Integrant methods for connecting to a Datomic Cloud database
https://github.com/hden/duct.database.datomic
Last synced: 3 months ago
JSON representation
Integrant methods for connecting to a Datomic Cloud database
- Host: GitHub
- URL: https://github.com/hden/duct.database.datomic
- Owner: hden
- License: epl-2.0
- Created: 2020-04-04T12:37:47.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-01T07:29:52.000Z (3 months ago)
- Last Synced: 2024-10-03T12:16:38.289Z (3 months ago)
- Language: Clojure
- Size: 66.4 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# duct.database.datomic
Integrant methods for connecting to a Datomic Cloud database.
Heavily inspired by the awesome [duct.database.sql](https://github.com/duct-framework/database.sql) library.
## Related Projects
- https://github.com/hden/duct.module.datomic - A Duct module that adds Integrant keys for a Datomic database connection and Ragtime migrations to a configuration.
## Installation
To install, add the following to your project dependencies:
```
[hden/duct.database.datomic "0.3.1"]
```## Usage
This library provides two things: a `Boundary` record that holds a database client and a database connection, and a multimethod for `:duct.database/datomic` that initiates a database spec into the Boundary.
```clojure
;; https://docs.datomic.com/client-api/datomic.client.api.html#var-client
{:duct.database/datomic {:server-type :ion
:region "AWS region"
:system "your system name"
:endpoint "http://entry.{{system}}.{{region}}.datomic.net:8182"
:proxy-port 8182
:database "db-name"}}
```When you write functions against the database, consider using a protocol and extending the `Boundary` record. This will allow you to easily mock or stub out the database using a tool like [Shrubbery](https://github.com/bguthrie/shrubbery).
## License
Copyright © 2020 Haokang Den
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.