I've just started using clj-record, and I like it. After starting to
write my own version of a very simplified Active Record, I discovered
clj-record and was very happy and relieved.
However, I'm getting bitten by underscores in table and column names.
I think that the answer is for clj-record to translate all underscores
to dashes in all table and column names, but I'm not sure.
Does anybody else who uses clj-record have underscores in table names
or foreign key names? To be honest, I can't fully describe the problem
I'm having because I've tried so many combinations of dashes and
underscores that my head is spinning :-)
For me, it seems to boils down to a problem with using either dashes
or underscores in model names (like "my.package.user-test" or
"my.package.user_test") and association names. You can't have a model
named my.package.user_test because Clojure/Swank won't find it if it's
in a file named my/package/user_test.clj --- the underscore is changed
to a dash and I end up seeing an error message something like "package
user_test does not exist". However, you can't have a model named user-
test because...because...I forgot why---my head is still spinning.
tl;dr version: how do I name models, tables, and foreign keys in the
Clojure code where the database uses underscores?
--
Jim Menard,
ji...@io.com