Ask questions on the official Q&A site at https://ask.datomic.com!
souenzzo 2021-02-16T12:07:20.270800Z

@alen checkout #datalog, #rdf, #asami, #datahike and many other datomic-like db's for hobby 🙂

souenzzo 2021-02-16T13:20:36.271400Z

Can I use db.attr/preds with database functions ?


We seem to have hit a snag. We have on-prem, but we reach it with the client api. If we install a database function with a peer connection, and we (datomic.client.api) tx-range over this transaction it triggers an exception: Could not marshal response: Not supported: class clojure.lang.Delay. Similarly, if we datomic.client.api/pull the database functions ident, we get the same marshal exception, whereas datomic.api/pull (with a peer conn) returns the fn without a hich. Is this a known bug?

defa 2021-02-16T14:11:06.274500Z

As I understand queries with fulltext search require :db/fulltext in the schema for that particular attribute to be true. Is it possible to alter the schema of an existing database to allow fullext search? When I transact [[:db/add :my-thingy/name :db/fulltext true]] I get an error:

:db.error/invalid-alter-attribute Error: {:db/error :db.error/unsupported-alter-schema, ...
What am I doing wrong?


You can't alter :db/fulltext , see: https://docs.datomic.com/on-prem/schema/schema-change.html#schema-alteration


You can rename the old attribute and create a new attribute (with db/fulltext). Here's an example: https://gist.github.com/ccfontes/3f566db393da14742a9a No experience with that approach though.

Phil 2021-02-16T14:27:54.279800Z

I've tried really hard to find an online example of using create-database with a sql/postgres backend. I spent the entire day yesterday trying to get this to work. I'm using datomic-pro. I can create a db using the "dataomic:free" image and my own datomic pro with "datomic:mem" but no luck with a real storage backend. I can't use cloud and don't want to be forced in to dynamodb or cassandra at this point. I'm trying to sell this stack to a new (non-clojure) group so I want to lower the number of new technologies at POC time. Any examples out there?

Phil 2021-02-17T12:48:19.292500Z

Answering my question above re on-prem and create-database https://docs.datomic.com/client-api/datomic.client.api.html#var-create-database > > NOTE: create-database is not available with peer-server. > Use a Datomic Peer to create databases with Datomic On-Prem.

Joe Lane 2021-02-16T14:40:22.280800Z

Hi @lennart.buit , could you file a support ticket and provide a stacktrace ( if there is one?)

Joe Lane 2021-02-16T14:55:08.283300Z

Best thing you could do would be creating a secret gist, showing a minimal repro, and then send it to <mailto:support@cognitect.com|support@cognitect.com>

Joe Lane 2021-02-16T14:57:42.284Z

This may interest you and your team. Appears to use postgres https://youtu.be/QrSnTIHotZE

favila 2021-02-16T15:15:30.284200Z

Unless this is a throwaway db that you know will never get big, I highly advise never using fulltext

favila 2021-02-16T15:16:34.284400Z

it’s “easy” but it gives you very little power, and the lucene index has some catastrophic misbehavior. and as your application and db grows and maybe you move off to elasticsearch or something, there’s no way to easily get rid of this index

Phil 2021-02-16T15:31:59.284600Z

thanks, I give that a run-thru tonight. From a quick look, I think I was using datomic.client.api . Is it correct that only datomic.api and not datomic.client.api is required?

Joe Lane 2021-02-16T15:52:13.284800Z

I'm not sure how best to answer that question @astro, but if you're still stuck after running through that project tonight (BTW, the source is linked in the video descriptioin) reach out and we can figure out what's going on, sound good?


Can do!

Phil 2021-02-16T16:15:46.285400Z

I watched more. Excellent resource. Thanks @lanejo01


:db/doc is a way to annotate an attribute. can i annotate an assertion?

Joe Lane 2021-02-16T20:40:58.286400Z

Hey @michael740, any reason you don't want to make your own attribute like the example you referenced?


Joe, no, I'm not opposed to creating new attributes

Joe Lane 2021-02-16T20:43:56.286800Z

I think I'm not understanding your question...


I'm about to un-deprecate at attribute of ours and I'd like to include some comments about why - specifically, why we're changing our mind about the deprecation. :db/doc doesn't seem appropriate, since it's per attribute (i think).


including the comments against the transaction entity would work, too.


i'm just curious whether i could go even more fine grained and include a comment against a specific assertion within a transaction. that was my original instinct, before i knew about the per-transaction annotations.


am i making any sense?

Joe Lane 2021-02-16T20:48:37.287800Z

I would attach either your own attribute or db/doc to the transaction entity if I was in your case. I think I understand the question. It's about documenting a change about 1 of n assertions within a transaction. Specifically, can you reify and individual assertion within a transaction of many assertions, right?


yep! and per-tx is perfect. sounds like assertions are not reified in the same way, which is fine.

Joe Lane 2021-02-16T20:50:01.288200Z

Great, does this resolve things then?


yep, thanks @lanejo01

Joe Lane 2021-02-16T20:50:40.288700Z

Great 👍 Always nice to hear from you @michael740!




Done, also, googling ‘datomic marshal error’ leads to a lot of comments by marshall about errors but not particularly about marshalling errors

Joe Lane 2021-02-16T21:39:41.289500Z

Not sure I can do much about that one haha