off-topic

https://github.com/clojurians/community-development/blob/master/Code-of-Conduct.md Clojurians Slack Community Code of Conduct. Searchable message archives are at https://clojurians-log.clojureverse.org/
dazld 2020-11-27T00:04:24.143Z

Both great suggestions, thanks

dazld 2020-11-27T00:05:49.144800Z

At back of my mind was something like a library that could warn if an index wasn’t being used, or partially used

dharrigan 2020-11-27T06:43:44.145700Z

Oh, you can run a SQL query for that. I'm sure you could adapt this to run within your application, to give you some insight...

dharrigan 2020-11-27T06:44:10.145900Z

SELECT s.schemaname,
       s.relname AS tablename,
       s.indexrelname AS indexname,
       pg_size_pretty(pg_relation_size(s.indexrelid)) AS index_size,
       idx_scan as index_scans
FROM pg_catalog.pg_stat_user_indexes s
   JOIN pg_catalog.pg_index i ON s.indexrelid = i.indexrelid
WHERE s.idx_scan = 0                     -- has never been scanned
  AND 0 <>ALL (i.indkey)                 -- no index column is an expression
  AND pg_relation_size(relid) > 5 * 8192 -- has some data in the table
  AND NOT i.indisunique                  -- is not a UNIQUE index
  AND NOT EXISTS                         -- does not enforce a constraint
         (SELECT 1 FROM pg_catalog.pg_constraint c
          WHERE c.conindid = s.indexrelid)
  AND s.schemaname = 'REPLACE_ME_WITH_YOUR_SCHEMA_NAME'
ORDER BY pg_relation_size(s.indexrelid) / nullif(idx_scan, 0) DESC NULLS FIRST,
         pg_relation_size(i.indexrelid) DESC;

👍 1
scythx 2020-11-27T09:17:33.147500Z

Hello, does anybody have clojure library recommendation to generate reports like invoice and db data?

borkdude 2020-11-27T09:55:00.148300Z

@raefaldhiamartya do you mean generate PDF or ...? and db data is a pretty general term? could you clarify your requirements?

scythx 2020-11-27T09:58:54.150300Z

yes a PDF. I want to export table of users info (email, fullname, ...) from db to pdf

dharrigan 2020-11-27T09:59:56.150500Z

<https://github.com/clj-pdf/clj-pdf> ?

❤️ 1
dharrigan 2020-11-27T10:00:28.151100Z

There are numerous libraries that can be used to query the database, with my particular favourites being next.jdbc with honeysql.

borkdude 2020-11-27T10:02:54.151800Z

You could also generate asciidoc or HTML and then generate the PDF from that.

❤️ 1
scythx 2020-11-27T10:05:58.152200Z

okayy, thank you!

alemedeiros 2020-11-27T12:23:27.154800Z

@raefaldhiamartya I've used clj-pdf at work before. it is quite simple to use and has a good performance. prior to that we generated a html then used a shell command to generate the pdf, doing everything inside clojure scaled better for our use case. (this might be an useful information depending on what you're trying to do)

❤️ 1
nate 2020-11-27T14:43:25.157200Z

@raefaldhiamartya I once wrote a report generator that created markdown which I sent through pandoc to generate a pdf. Worked really well.

❤️ 1
2020-11-27T15:01:19.161700Z

they don't have a dmg yet, just a zip..

2020-11-27T15:01:42.162400Z

so had to set JAVA_HOME in my shell and my Emacs

borkdude 2020-11-27T15:06:14.165200Z

@kbsant That's what I do with GraalVM all the time. I don't use any installers, just download the gzip, unpack it in my Downloads and it sits there for about half a year until the nnext version

2020-11-27T15:11:25.167800Z

@borkdude thats nice and clean, just discovered it now that a dmg was unavailable. so far tools work fine, so i'll stick to tar.gz

jpcenteno 2020-11-27T15:46:18.170800Z

https://notamonadtutorial.com/rebuilding-the-racket-compiler-with-chez-scheme-210e23a69484 Not specifically Clojure, but the Racket team ported it’s compiler from C to Chez Scheme. With some coworkers, we interviewed Matthew Flatt & Gustavo Massaccesi that took part of that effort.

2020-11-27T16:26:19.171Z

Btw I'm maintaining homebrew cask for graalvm https://github.com/DeLaGuardo/homebrew-graalvm

2020-11-27T16:36:56.171300Z

brew tap DeLaGuardo/graalvm and then brew search graalvm it should give you all available versions

borkdude 2020-11-27T16:38:35.171500Z

nice!