Related to https://github.com/dresende/node-orm/issues/36#37
Conversation
There was a problem hiding this comment.
I understand these changes, but not the ones on orm.js.
|
OK, I think I understand now, the diff is not very smart and mixed a lot of same lines just because of different indentation. If the next lines make sense to you and you agree, I'll change the behavior:
|
|
Well, above three is exactly what my diffs do :)
Regarding, connectors' code duplication, I'm planning to wrote a prototype class (says, Connector) implementing DBQuery, DBClient and such so individual connectors can extend without repetitive code. |
|
Ok, I'll make the changes on my local repo (I can't merge automatically now) and I'll assign you as the author. In lib/databases/ you have an example.js DBClient which should be updated. For SQL databases some methods could be reused but for example for MongoDB this is not so easy (and contraints don't apply). In the case of MongoDB (or CouchDB) the database connectors need to have access to the contraints to apply them. |
Allows to
CREATE TABLE "product" ("id" SERIAL, "name" VARCHAR(255) NOT NULL, "description" VARCHAR(255) DEFAULT '', "datecreated" TIMESTAMP NOT NULL, PRIMARY KEY ("id"))
INSERT INTO "product" ("name", "datecreated") VALUES ($1, $2) [ 'Birds', '2012-02-12T18:10:46.133Z' ]
without error about constraint violation. Attributes without DEFAULT must be NOT NULL and populated by user.
On UPDATE, allow to accept partial model updates.
Assume the following scenario:
Another scenario may looks like: