This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-30
Channels
- # announcements (5)
- # beginners (3)
- # biff (11)
- # cider (5)
- # clj-kondo (5)
- # cljdoc (4)
- # clojure (18)
- # clojure-dev (7)
- # clojure-europe (5)
- # clojure-gamedev (8)
- # clojure-norway (223)
- # clojurescript (4)
- # data-science (22)
- # emacs (5)
- # exercism (2)
- # fulcro (2)
- # graalvm (6)
- # jobs-discuss (4)
- # lsp (16)
- # matrix (1)
- # off-topic (41)
- # scittle (16)
- # xtdb (3)
I want a really simple way to persist clojure maps, without learning database semantics. The main use case is prototyping and small projects. What is the best library/way to do this?
> without learning database semantics I'm curious what you mean by this @U6D1FU8F2? The basics of storing and retrieving hash maps in/from a database are straightforward via https://cljdoc.org/d/com.github.seancorfield/next.jdbc/1.3.909/doc/getting-started/friendly-sql-functions and you can use a local on-disk database without needing to install or run a separate process (H2, SQLite, Derby, etc). The only thing you need to do upfront is create tables for the data to live in -- is that the "database semantics" you want to avoid learning?
@U04V70XH6 yeah, I am looking for the simplest way to go from an in-memory clojure map to making that persistent, for smaller projects. conceptually working with normal clojure functions (like get, assoc, etc.) is simple and consistent, albeit not scalable
i finally found a usecase for iteration
. very cool but dang this is a hard function to use correctly lol
I've been a big fan of it, but during dev time I always wrap it in an education with a map-indexed transducer that throws after some number of iterations, because I always end up accidentally in an infinite loop hammering the endpoint I'm hitting
I just do (take 1)
or (take 5) as i need to when developing lol
Getting all of my scrobbles from the http://last.fm api for the year with their paginated endpoint