I set up an SQL table in sqlite3 with the following command:
CREATE TABLE "userstrings" (
'user_id' INTEGER NOT NULL,
'cat_id' INTEGER NOT NULL,
'name_id' INTEGER,
CONSTRAINT unq UNIQUE(user_id, cat_id, name_id)
)
I'm still wiring up the user interface but I noticed in the table there were four rows all with user_id = 10, cat_id = 8, and name_id = NULL.
Does NULL somehow circumvent unique constraints? Ultimately, the goal is to only allow unique rows, and to allow name_id to be null.