I'm trying to make a small demo application with orm. I'm using postgresql and clsql with sbcl. When there is one table everything seems to work: I can insert new records and modify them, and also read if I modify the database manually. But when I try to make an object that points to another object and store it like a foreign key (to an existing line in a table), the foreign key is not inserted (I have a null value instead).
I tried to make an example similar to this: http://clsql.kpe.io/manual/def-view-class.html.
Is it possible to do what I'm trying to to with these tools? Do I need to override reader and writer methods to make it work?
Thank you.
clsql: foreign key not saved in database
-
- Posts: 1
- Joined: Sat May 23, 2015 6:17 am
Re: clsql: foreign key not saved in database
Hello,
I see that nobody replied to your post. From your post, it looks like you have an object hierarchy model that you want persisted into your database. This sounds suspiciously like a problem for ORMs to handle. Have a look at CLIKI - ORM for ORM libraries in CL.
In short, you have two options:
I see that nobody replied to your post. From your post, it looks like you have an object hierarchy model that you want persisted into your database. This sounds suspiciously like a problem for ORMs to handle. Have a look at CLIKI - ORM for ORM libraries in CL.
In short, you have two options:
- * Straighten out your UPDATE/INSERT queries that they exactly reference the right tables and objects
* Use an ORM