This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-18
Channels
- # ai (6)
- # announcements (3)
- # babashka (5)
- # beginners (22)
- # calva (1)
- # cider (3)
- # clj-kondo (30)
- # clj-yaml (20)
- # clojure-europe (83)
- # clojure-spec (4)
- # clojurescript (6)
- # fulcro (1)
- # graalvm (16)
- # holy-lambda (5)
- # malli (33)
- # music (1)
- # nbb (14)
- # releases (3)
- # sci (13)
- # scittle (3)
- # shadow-cljs (35)
- # xtdb (7)
- # yada (2)
So, I have run into an issue that I am unable to solve... I have an nbb app that I am working on, and it's now at the point that I want to package it... The app requires the presence of an sqlite3 database, and having set up an index.mjs and made the relevant additions to the package.json I have arrived at a point where the app runs successfully with its configured "binary" name if I run it in the actual directory where the code is, or if I run it by navigating to the location of the link that's created by running npm install -g
(in my case /usr/lib/node_modules/birthdayman-sqlite), however running it anywhere else gets me this huge error ( https://pastebin.com/hKx6Nk9a ), which seems to be the app complaining that the DB is not present. The thing is that it is present. The Github repo is https://github.com/maleghast/birthdayman-sqlite - any help gratefully received; I don't want to push it to https://www.npmjs.com until I know it's going to work (clearly), Thanks in advance
(Oh, I know that the repo does not have a file named birthdays.db
I will rename the file birthdays.db.template
as the blank db when I am done testing - I have a birthdays.db
in my path / version on my machine)
(and yes the README.md is out of date now too, but I will update it properly once I have fixed all this stuff š )
@maleghast https://github.com/mifi/stacktracify or https://github.com/xfthhxk/unminify may help you investigate the stack trace and give you hints at the problem. I haven't had need to use these so no further advice off the top of my head.
@maleghast I think here:
(def db (sql. (str (path/resolve) "/birthdays.db")))
the db always is picked from the current working directory
A few ideas:
ā¢ Always pick ~/.birthdayman/birthdays.db
or so
ā¢ Support an env var so people can tweak the location
ā¢ Always locate the db close to the script, e.g. using *file*
@borkdude - Thanks, I've fixed it using *file*
- just one question, how do I get clj-kondo to accept *file*
as it works, clearly, but cll-kondo sees it as an unresolved symbol
Thanks, @borkdude that worked perfectly and it's live -> https://www.npmjs.com/package/birthdayman-sqlite Not really expecting anyone to use it, but I am actually using it, so I thought I may as well put it up and see if people use it š