Duplicate key names, introduced in 1b55ad8, do not play
well with rkey methods like Get, so I decided to undo
the change and settle for unique key names and
"key type mismatch" checking.
Unlike the v0.3 implementation, Redka now checks for
"key type mismatch" situations using the NOT NULL constraint
on rkey update instead of a separate ON UPDATE trigger, so
there is (almost) no performance penalty.
The general advice still applies:
Please don't use the same key for different data types.
It's a VERY bad idea.
Redka aims to support both mattn and modernc SQLite drivers,
but they are incompatible in how they handle parameters in
multi-statement Exec calls.
Creating two separate Exec strategies seems premature at this
point, so I refactored all Exec queries back to single statements
and changed all params to positional. This way, both mattn and
modernc drivers work fine.
Because Redis uses a global key namespace, it's possible to
create a key of one type (e.g., a string) and then try to
work with is as if it were of another type (e.g., a hash).
I call this a "key type mismatch" situation.
Redis' handling of key type mismatches is a mess. Sometimes
it allows them (SET), sometimes it ignores them (MGET),
sometimes it forbids them (HSET).
Starting with this commit, Redka takes a more consistent
approach. Now you can use the same key for different data
types, and everything will work fine. With a small caveat:
the `type` column in the `rkey` table will store the last
modified type (it doesn't affect any operations though).
Having said that. Please don't use the same key for
different data types. It's a VERY bad idea.
I never quite understood the use case for MSETNX, so I searched
the Redis repo issues and StackOverflow. I didn't find a single
real-world scenario for using this command, so I decided to remove it.