I am new to mudlet and I was working through the manual as well, trying to learn how to use the databases in mudlet, and I have run into the same problem.
LUA: ERROR running script ^mudlettest (Alias130) ERROR:./mudlet-lua/lua/DB.lua:627: Failed to add
item: this is probably a violation of a UNIQUE index or other constraint.
I did search the forums and saw that Vadi posted about using db:merge_unique() in place of the db:add() function. Unfortunately this solution hasn't worked for me either. I receive a different error,
LUA: ERROR running script ^mudlettest (Alias130) ERROR:./mudlet-lua/lua/DB.lua:922: db:merge_unique
only works on a sheet with a unique index.
I looked at the database file using SQLite Sorcerer and the sheet in the database doesn't seem to have any fields aside from the standard "_rowid". I've tried different ways of initializing the database creation but I can't get it to actually create any fields (which is likely why db:add() and db:merge_unique() are not working).
So I am not quite sure how to go about actually using the databases in mudlet at this point. I am following the basic steps from the manual, posted at the beginning of this thread, and can't seem to get anything working regarding databases.
Any help would be greatly appreciated!