On-prem, of course 😉
We did copy the Postgres data with pgdump & psql -f
, but now we seem to end up with partial data, with entries that consist of :datomic-replication/source-eid
. Is that expected, or are we expecting something that cannot work?
Hi all! I'm swapping out on-disk storage with dev-local for an in-memory database (I don't need durability for CI/tests) and I've followed the docs here by adding :storage-dir :mem
to my client config…
https://docs.datomic.com/cloud/dev-local.html#memdb
That call is blowing up with this trace however:
1. Caused by java.lang.IllegalArgumentException
No implementation of method: :as-file of protocol:
#'<http://clojure.java.io/Coercions|clojure.java.io/Coercions> found for class: clojure.lang.Keyword
core_deftype.clj: 583 clojure.core/-cache-protocol-fn
io.clj: 35 <http://clojure.java.io/fn/G|clojure.java.io/fn/G>
io.clj: 424 <http://clojure.java.io/file|clojure.java.io/file>
io.clj: 418 <http://clojure.java.io/file|clojure.java.io/file>
impl.clj: 331 datomic.dev-local.impl/require-storage-dir!
impl.clj: 328 datomic.dev-local.impl/require-storage-dir!
impl.clj: 340 datomic.dev-local.impl/create-client
impl.clj: 337 datomic.dev-local.impl/create-client
impl.clj: 373 datomic.dev-local.impl.DevLocal/fn
Atom.java: 37 clojure.lang.Atom/swap
core.clj: 2352 clojure.core/swap!
core.clj: 2345 clojure.core/swap!
impl.clj: 361 datomic.dev-local.impl.DevLocal/_impl_configure_system
impl.clj: 433 datomic.dev-local.impl/ensure-client
impl.clj: 423 datomic.dev-local.impl/ensure-client
Var.java: 384 clojure.lang.Var/invoke
impl.clj: 24 datomic.client.api.impl/dynarun
impl.clj: 21 datomic.client.api.impl/dynarun
impl.clj: 31 datomic.client.api.impl/dynacall
impl.clj: 28 datomic.client.api.impl/dynacall
api.clj: 100 datomic.client.api/client
api.clj: 48 datomic.client.api/client
That looks to me like I should have a :storage-dir
that's resolvable to a file but the docs say this keyword :mem
is supported. Given it's gone 5pm here and it's been a long week I'm guessing this is me missing something obvious but it's not jumping out at me…
I'll try jacking in and see if I can jump to the source to see how this works. Clojure is so awesome! 😄My client config looks like this:
{:server-type :dev-local
:storage-dir :mem
:system "ci"}
Can you provide the code you're using to get this stacktrace?
@kenny it's the call to datomic.client.api/client
in this component:
(defrecord Datomic [client-config conn db-name]
component/Lifecycle
(start [c]
(let [client (d/client client-config)
_ (d/create-database client {:db-name db-name})
conn (d/connect client {:db-name db-name})
tx-data (schema c)]
(d/transact conn {:tx-data tx-data})
(assoc c :client client :conn conn)))
(stop [c]
#_(some-> c :client (d/delete-database {:db-name db-name}))
(dl/release-db client-config)
(dissoc c :client :conn)))
The next line in the trace would be the (let [client (d/client ...
line above.
Thanks. What version of dev-local are you running?
I've tapped the client-config
just to be safe, and can see this in REBL:
Versions coming right up! 🙂
com.datomic/dev-local {:mvn/version "0.9.203"}
Can you try updating to the latest 0.9.229? Also ensure you're on the latest client version 0.8.102.
Will do!
Client is up to date. Bumping dev-local now and restart my JVM.
Progress! Looks like updating the dev-local dep has gotten me the :mem
support I need. Now I just need to pass in :system
and :db-name
to release-db
.
I wonder if I can merge the client config and the arg-map
passed to release-db
et al… :thinking_face:
Probably not a good idea.
I could be mistaken but I believe release-db has always needed a :db-name.
If you'd like to release all dbs, you can call d/list-databases and loop over that.
Makes sense. Thanks for the pointers, @kenny!
I wonder if there's a footnote to add to spec-ulation about acretion not helping people like me with old code and newer docs. 😄