`Database error 42P01: relation "kana_text" does not exist` from CLI due to `switch-conn-vars`
Heliozoa opened this issue · 2 comments
Hi,
Thanks for your work on ichiran.
I was able to prepare the ichiran database using the dump according to the instructions in the blog post (https://readevalprint.tumblr.com/post/639359547843215360/ichiranhome-2021-the-ultimate-guide) with all the tests passing, but when I would build the CLI and try to use it, it was unable to find the database tables.
❯ ./ichiran-cli "こんばんは"
ERROR: Database error 42P01: relation "kana_text" does not exist
QUERY: (SELECT * FROM kana_text WHERE (text IN (E'は', E'んは', E'ん', E'ばんは', E'ばん', E'ば', E'んばんは', E'んばん', E'んば', E'ん', E'こんばんは', E'こんばん', E'こんば', E'こん', E'こ')))
Since the tests worked and I could confirm that the relation does exist with psql
, it appeared to me that the CLI might be using some default connection details instead of the ones I gave in the settings.lisp
file. I tried removing the following lines which fixed the issue:
Lines 95 to 96 in 3c8891f
I don't know the purpose of these lines, so I decided make an issue instead of a PR removing them.
I see, I must just have gotten lucky/unlucky. I tried building it and running the command several times yesterday and it worked as soon as I removed those lines, however today I can no longer reproduce the issue... Maybe there was some temporary issue with my system that went away after a restart. Sorry for the noise!