Skip to content

Conversation

jonasseglare
Copy link

@jonasseglare jonasseglare commented Jun 4, 2021

This PR makes the following contributions to Wanderung:

  • A new function transact-datoms-to-datomic for putting data into datomic
  • Support for migrating datoms to and from nippy-encoded files: this is probably a suitable backup format.
  • Refactoring of wanderung.core and the commandline interface.

An important change that I made to the interface of the program is that instead of passing a -d or --direction option specifying the type of source and target databases on the commandline, the type of database is instead stored under the key :wanderung/type in the database configuration. I am happy to discuss whether this is a good or bad idea. So for instance, the config of a datomic database now looks like this:

{:wanderung/type :datomic
 :name "your-database"
 :server-type :ion
 :region      "eu-west-1"
 :system      "your-system"
 :endpoint    "http://entry.your-system.eu-west-1.datomic.net:8182/"
 :proxy-port  8182}

and, for example, the configuration for a file that stores nippy-encoded datoms looks like this:

{:wanderung/type :nippy
 :filename "backups/mybackup.nippy"}

The main reason for this change is that it leaves less room for mistakes since it is no longer possible to specify a direction with the -d flag that is inconsistent with the configurations.

We wrote this code at Jobtech to be able to create and restore backups of our Taxonomy database.

@jonasseglare jonasseglare changed the title Add function transaction-datoms-to-datomic Add function transact-datoms-to-datomic Jun 4, 2021
@jonasseglare jonasseglare changed the title Add function transact-datoms-to-datomic Support migration to datomic, support for saving datoms in nippy, refactoring of core Jun 15, 2021
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including this file in the project makes it possible to refer to the project from deps.edn, e.g. io.lambdaforge/wanderung {:git/url "https://github.com/jonasseglare/wanderung" :sha "fe35e0282f787d7f519acc9201ee99eb3eb881ec"}}.

Copy link
Member

@kordano kordano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonasseglare looks good. Thanks for your contribution!

@kordano kordano merged commit 9bb49a6 into lambdaforge:master Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants