This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-09
Channels
- # announcements (9)
- # beginners (69)
- # cider (4)
- # clj-kondo (8)
- # cljdoc (1)
- # clojure (52)
- # clojure-austin (4)
- # clojure-europe (22)
- # clojure-nl (2)
- # clojure-norway (14)
- # clojure-uk (3)
- # clojurescript (9)
- # conjure (4)
- # cursive (3)
- # datalevin (13)
- # datomic (4)
- # events (2)
- # fulcro (59)
- # graalvm (17)
- # helix (25)
- # inf-clojure (4)
- # integrant (4)
- # introduce-yourself (2)
- # java (5)
- # kaocha (1)
- # leiningen (3)
- # meander (7)
- # nbb (4)
- # off-topic (30)
- # portal (4)
- # rdf (1)
- # reagent (5)
- # sci (1)
- # shadow-cljs (57)
- # sql (8)
- # tools-deps (39)
- # uncomplicate (3)
- # vim (3)
- # xtdb (8)
Hi,
I’m working with SQLite on my project and using jdbc.next.
I want to load to my SQLite DB a JSON file with a complex and not strict structure.
From what I understood it’s not really possible with jdbc.next
as I need to well define the structure when I create the table.
While searching for a solution I came across https://sqlite-utils.datasette.io/en/stable/cli.html#inserting-json-data, but I couldn’t find a Clojure implementation.
Does anyone know what is the best way to tackle this thing with Clojure?
Thanks
sqlite supports storing json https://www.sqlite.org/json1.html
Thanks for the answer. Sorry for the newbie question, but how can I use it in Clojure?
just create text fields in your database and then convert to json before writing to the db and parse json after reading from the db.
The main task that I have is actually taking a JSON file with multiple objects that have different (partially common) scheme and add all the file to a table in my SQLite database.
you could put the common fields into columns and write the rest into a text field as json, then?
and then use the functions I linked when you need to query on json
Thanks