Fork me on GitHub
#xtdb
<
2021-09-08
>
teodorlu10:09:25

Another question. It's possible to start crux.http-server/server without writing any code, from a docker image or a .jar. Is it possible to configure the URL prefix for the HTTP server without writing code? Either change /_crux/ to something else, or host on /$MY_PREFIX/_crux/...? From the https://opencrux.com/reference/1.18.1/http.html and the https://ring-clojure.github.io/ring/ring.adapter.jetty.html I'm guessing the answer is that I'll have to write some code.

jarohen10:09:46

Hey - yep, have a look at https://opencrux.com/reference/installation.html, or https://opencrux.com/reference/building.html if you want to build a custom Docker image/JAR (with your own selection of modules)

πŸ‘ 2
jarohen10:09:46

regarding the prefix: there's not a code-free way to configure this at the moment, I'm afraid - you'll have to pull in the Ring handler

πŸ‘ 2
teodorlu10:09:30

That's what I expected. Thanks!

teodorlu12:09:27

Yet another question! How do I escape question marks in GET query parameters to the HTTP module? --- I want to use GET /_crux/tx-log (https://opencrux.com/reference/1.18.1/http.html#tx-log) with get documents in the response, but I can't seem to set with-opts? to true. I've tried:

curl -H "Accept: application/json" "${MY_HOST}/_crux/tx-log?with-opts?=true" 2>/dev/null  | jq
curl -H "Accept: application/json" "${MY_HOST}/_crux/tx-log?with-opts%3F=true" 2>/dev/null  | jq
I found https://github.com/xtdb/xtdb/blob/main/modules/http-server/test/xtdb/http_server/json_test.clj#L161..L167, but I don't know how dakrone/clj-http encodes GET parameters. PS. congrats on the new name πŸ™‚

jarohen12:09:18

blimey, you can't keep anything quiet for long around here πŸ˜‰

jarohen12:09:36

'official' announcement to come shortly πŸ˜„

jarohen12:09:56

good spot! πŸ¦…

πŸ˜„ 2
πŸ‘οΈ 2
nivekuil12:09:37

extensible temporal?

teodorlu12:09:59

I dug into the HTTP client, and as far as I can tell, {:query-params {"with-opts?" true}} encodes into {:query-string "with-opts%3F=true"}.

refset13:09:25

> curl -H "Accept: application/json" "http://localhost:3000/_crux/tx-log?with-opts%3F=true" seems to work for me :man-shrugging: (testing with Docker juxt/crux-standalone-rocksdb:1.18.0)

2
refset13:09:39

> extensible temporal? cross-time!

nivekuil13:09:05

cross-time is better, actually, since it lets me justify keeping the api aliased to c

πŸ™Œ 2
tatut12:09:46

I want to soft delete a document and record which user did the deletion, is there a common pattern? My first thought would be to :crux.tx/put a new version of the document that only has the "who deleted this" info and nothing else... instead of deleting the doc outright

nivekuil12:09:19

ah, you've moved :valid-time and :tx-time under the same namespace! that's actually a really nice cleanup :)

πŸ™ 4
Steven Deobald14:09:29

@U797MAJ8M We tried to keep keyword namespace changes to a minimum (beyond renaming crux to xtdb) ... but not without a lot of debates first. πŸ™‚ We're quite open to hear suggestions and preferences for these. We could do another round of improvements, potentially.

Noah Bogart13:09:35

With the name change announcement, are you going to rename this channel to #xtdb? https://xtdb.com/blog/crux-to-xtdb-rename.html

Noah Bogart13:09:46

oh it looks like that channel already exists?

Noah Bogart13:09:12

maybe @seancorfield could do a rename so we don’t lose history or force 539 people to migrate to a new channel

βž• 4
emccue13:09:52

oh wow the db name changed

jarohen13:09:34

Hey folks - as you've no doubt seen above, we're now XTDB 🍾 https://xtdb.com/blog/crux-to-xtdb-rename.html Kudos to the eagle eye of @teodorlu for spotting it within about 5m of me transferring/renaming the GitHub repo πŸ˜† We've released a 1.19.0-beta1 version today for people to test their migrations: β€’ By and large, it's a 'find crux, replace with xtdb', full migration guide on the https://github.com/xtdb/xtdb/releases. β€’ We've kept unrelated changes out of this release, but it has been an opportunity to get all our keywords in the same namespace - we recommend (:require [xtdb.api :as xt]) , then ::xt/put , ::xt/valid-time β€’ On-disk format remains the same, no data migrations required this time, and you should be able to run this as a rolling upgrade (i.e. you shouldn't need to simultaneously update all of the Crux nodes in a cluster to XT nodes) If you do run into any issues, give us a shout - cheers! πŸ™‚

πŸŽ‰ 16
πŸ˜„ 6
nivekuil14:09:44

are the on disk representations ever going to change or are the crux namespaced keys planned to be around indefinitely?

jarohen14:09:06

I can't promise that they'll never change, but it's certainly not a decision we'd make lightly - we recognise it'll mean a substantial migration for anyone with existing instances. We're looking to make some more substantial changes to XT over the next 6-12m which will likely involve that kind of migration, but there'll be plenty of notice for those πŸ™‚

βœ”οΈ 4
oxalorg (Mitesh)15:09:13

XTDB sounds super cool r2d2πŸ₯·. Loving the new name!! πŸŽ‰

catjam 2
avocade14:09:55

πŸ₯‚

🎩 4
Noah Bogart14:09:09

This is a great change, I think. Is XTDB still under Juxt’s umbrella?

jarohen14:09:32

absolutely, yep πŸ™‚

πŸ‘ 4
nate14:09:07

JuXTBD

πŸ˜† 6
souenzzo15:09:47

(defn juxt-names 
  [s]
  (string/join (reverse (take 4 (reverse s)))))
=> #'user/juxt-names
(juxt-names "juxtdb")
=> "xtdb"

Steven Deobald15:09:35

Oh no, we are found out πŸ™ˆ

maleghast15:09:19

Wow, this was unforeseen, but I ❀️ the new name - Congrats!

πŸ™ 2