Am 10.03.2012 09:06, schrieb Kit:
2012/3/9 Christoph P.U. Kukulies<k...@kukulies.org>:
CREATE TABLE instance  (
          path TEXT,
          basename TEXT,
          size INT,
          md5sum TEXT,
          creation_date TEXT,
          last_write_time TEXT,
          FOREIGN KEY (md5sum) REFERENCES resource (md5sum)
          );

CREATE TABLE resource (
          md5sum TEXT,
          data BLOB,
          primary key(md5sum)
        );

What makes the contents of two files equal (so that their contents can be
represented by the same resource) ?
md5sum = md5sum

My problem: what do I have to change in TABLE instance so that I can use it
to determine whether the key is already
in the resource TABLE?
- Make new md5sum from new data
INSERT OR IGNORE INTO resource ...
INSERT OR REPLACE INTO instance ...

Thanks a lot. What is the idea behind the INSERT OR REPLACE in your solution?

--
Christoph

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to