Fork me on GitHub
#datomic
<
2017-04-19
>
souenzzo11:04:26

kschrader: on a pedestal app, have a :tx-data key on request, that hold arbitrary tx info generated by interceptors, and a audit interceptor ;)

kschrader01:04:27

feedback welcome šŸ™‚

bherrmann11:04:41

@kschrader Humm. I thought with the newer datomic, you dont need to use ā€œd/tempidā€ - you can just use strings. A slight simplification.

foobar11:04:55

I get connection refused when trying to connect to my peer server, any thoughts?

souenzzo11:04:56

No tempid -> :db.part/user. He want to install this data on :db.part/tx @bherrmann

bherrmann12:04:43

Ok, makes sense - thanks

maleghast12:04:25

Hello everyone... Does anyone have a quick answer to this: What data type should I use to store lattitude and longitude in Datomic?

Lambda/Sierra12:04:03

@maleghast Depends on how you want to query it. Two decimal attributes seems like the most obvious. Datomic doesn't have any spatial-indexing capability, so if you're doing something like looking for entities within a range of latitude/longitude, it will be 2 index hits plus a join.

maleghast12:04:34

@stuartsierra Thanks that's very helpful šŸ™‚

Lambda/Sierra12:04:45

If you need true geospatial indexing, you'll need to maintain a separate index in a tool that supports that.

maleghast12:04:06

*nods* I am building a postgis database to handle geospatial data, but I want to associate the data I am putting in Datomic with as many attributes as possible, so that the data is richer beyond the bare minimum. I am using Datomic to store daily meteorological observations from a number of measuring stations, and so in defining the stations I am including their location and elevation as attributes.

dominicm14:04:20

What's the best way to get a one-off number of transactions in the txor?

robert-stuttaford14:04:53

(count (seq (d/datoms db :aevt :db/txInstant))) ?

dominicm14:04:57

@robert-stuttaford If I'm honest, wanted to make sure that wouldn't blow up my box šŸ˜›

dominicm14:04:03

But actually, I imagine count is pretty good

robert-stuttaford14:04:31

i can do this fine and we have in excess of 40 million

dominicm14:04:16

Good enough for me!

robert-stuttaford14:04:18

the problem is t values are sparse, so its not a valid representation of the count at all

dominicm14:04:31

Yeah, I noticed that. I also tried txid, but that gave me a different value.

eraserhd16:04:40

I have two databases, named ā€œdevā€ and ā€œprodā€. Iā€™ve backed up ā€œprodā€, and now I want to restore it over ā€œdevā€. I get the error ā€œThe name ā€˜devā€™ is already in use by a different database.ā€ This is using Dynamo. Is it sufficient to delete and recreate the Dynamo DB, then restore to it?

lvh16:04:18

Letā€™s say I have a bunch of rules. They normally use an implicit database. However, I may want to query against a database and a seq of facts. Itā€™s a little annoying to always have to type the $ arg as an argument to the rule. Is there a convenient way to do like, (with-db $2 ...)

eraserhd16:04:35

Apparently, if I d/delete-database then d/create-database, I still canā€™t restore the database because itā€™s already in use by the other database.

eraserhd16:04:20

So, it seems if I want to dump and restore different databases, they have to have the same ending segment in the database URI.

marshall16:04:18

Just delete and restore

marshall16:04:25

The restore will create it

eraserhd17:04:04

this worked

Petrus Theron17:04:48

Any known issues running Datomic in a Docker container on OSX via docker run my-image based on Pointslope image? (https://github.com/pointslope/docker-datomic). Exception on d/connect:

java.util.concurrent.ExecutionException: org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: localhost:4335" [90067-171]
Datomic seems to be running:
docker run 8f4db5ba0824
Launching with Java options -server -Xms1g -Xmx1g -XX:+UseG1GC -XX:MaxGCPauseMillis=50
Starting datomic:, storing data in: dev-data ...
System started datomic:, storing data in: dev-data
Exposed ports: 4334, 4335, 4336

marshall17:04:19

You'll need to set alt-host to the ip of the docker machine @petrus

Petrus Theron17:04:35

Managed to connect by mapping ports explicitly: docker run -p 4334-4336:4334-4336 0ac10e837e84 Now I'm getting Could not find mydb in catalog

marshall17:04:40

Sounds like you need to create-database

csm19:04:56

so, Iā€™m trying to initialize a database with a schema, but Iā€™m getting errors about duplicate datoms in the transaction, but the ones it complains about are not duplicates.

csm19:04:46

{:d1 [63 :db/ident :user/guid 13194139534312 true], :d2 [63 :db/ident :user/email 13194139534312 true]}

favila19:04:18

"duplicate" meaning conflict @csm

favila19:04:43

both these datoms cannot be true

favila19:04:12

entity 63 cannot have both ident :user/guid and :user/email

csm19:04:34

Iā€™m not specifying 63 anywhere

favila19:04:51

are you using the same tempid for two different schema maps?

favila19:04:40

this is the minimum that reproduces?

csm19:04:55

it is not, no. It is part of a larger schema

csm19:04:00

which I canā€™t share

favila19:04:11

I mean, if I issue this tx in isolation, will it cause an error?

favila19:04:35

I guess I'll just try

csm19:04:01

I wasnā€™t able to reproduce it on my machine, itā€™s only happening on my colleagueā€™s system. Same version of datomic

favila19:04:25

works for me with test db

favila19:04:45

it is suspicious that :user/email lacks a db/id but the other one has

csm19:04:54

this happened before with two unrelated attributes; I added the :db/id "user/guid" to :user/guid and that worked

csm19:04:14

so, do I need to specify a temporary :db/id for every attribute?

favila19:04:26

in theory you don't but that's a new feature

favila19:04:11

But this sometimes happens when the transactor itself creates a tempid, and the client-set and server-set tempids collide

favila19:04:58

are you sure this is exactly what hits the d/transact call? no other transformations (e.g. adding tempids) beforehand?

favila19:04:22

or using a tx function

csm19:04:48

no tx functions, and Iā€™m reasonably sure nothing adds tempids

csm19:04:18

we are also going through the peer server

favila19:04:34

ah, so this is sent from client api

favila19:04:03

I didn't test that, I just issued it directly

favila19:04:15

something is fishy

favila19:04:33

having explicit :db/id is likely going to resolve it

favila19:04:39

(as a workaround)

favila19:04:47

but this needs more investigating

csm19:04:56

yeah, Iā€™m just going to add very unique :db/ids to everything

csm19:04:12

..which did indeed work

favila19:04:43

if you are paying for datomic support you should open a ticket @csm

favila19:04:27

(i.e. if you are licensed)

csm19:04:12

we have a starter license, and are planning on paying later (we are still only in development now)

jaret20:04:58

@csm You should still open a ticket with us. We'd like to take a look at any repro you could provide.

foobar22:04:58

Can you install db fns using the datomic client api?