Skip to content

roterski/fulcro-rad-xtdb

Repository files navigation

XTDB Database Plugin

Note Crux database has been renamed to XTDB (see crux → xtdb migration guide).

fulcro rad xtdb

This is a plugin for Fulcro RAD that adds support for using xtdb (formely known as Crux) databases as the back-end technology.

This repo bases on fulcrologic/fulcro-rad-datomic adapted to xtdb api with some Datomic specific features dropped (e.g. schemas and Datomic Cloud support).

Status

It’s a very first alpha iteration - it passes integration test and seems to be working properly with roterski/fulcro-rad-demo but has not been tested outside of it yet.

Configuration

There is an example application roterski/fulcro-rad-demo that can be referenced for how to properly configure this plugin.

xtdb-adapter/start-databases expects a map with :roterski.fulcro.rad.database-adapters.xtdb/databases key that contains configuration maps for each defined database. Configuration maps are then passed directly to xtdb.api/start-node so please refer to xtdb documentation for available options.

:roterski.fulcro.rad.database-adapters.xtdb/databases
    {:main {:xtdb.jdbc/connection-pool {:dialect #:xtdb{:module "xtdb.jdbc.psql/->dialect"}
                                        :db-spec {:dbname   "fulcro-rad-demo"
                                                             :user     "postgres"
                                                             :password "postgres"}}
            :xtdb/tx-log               {:xtdb/module "xtdb.jdbc/->tx-log"
                                        :connection-pool :xtdb.jdbc/connection-pool}
            :xtdb/document-store       {:xtdb/module "xtdb.jdbc/->document-store"
                                        :connection-pool :xtdb.jdbc/connection-pool}}}

Because xtdb expects module names to be symbols, there’s a convenience function xtdb-adapter/symbolize-xtdb-modules that symbolizes values under :xtdb/module so you can store them as strings in edn file.

(require '[roterski.fulcro.rad.database-adapters.xtdb :as xtdb])

(xtdb/start-databases (xtdb/symbolize-xtdb-modules config))

LICENSE

The MIT License (MIT) Copyright (c), Fulcrologic, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published