Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
No error is thrown if the primary key has none of the expected types #59
I have it in a codepen.
Basically if the "pk" key is not one of "int", "uuid", etc, an error is thrown in the code (adapter-IndexedBD line 117) but it never reach the the top-level call. This means that neither then or catch is called after the exec.
console.log( 'ERROR: if the type of the ai key is string, then no error is thrown')
This is (mostly) expected behavior. You can set whatever valued you'd like for the primary key (in practice it's reduced to a string or number, though). You can set whatever type you'd like as the primary key and nanoSQL will work just fine, for example I'll often set a primary key as a
The problem happens when you provide a primary key type that can't be auto generated AND you fail to provide a primary key, I already had
Thank you a lot Scott!
I spent like 1 hour finding out why it was "not working". I mean, I executed, reviewed things over and over, the DB was not been modified... so I started to follow up the internal code of nanoSQL till I found I made a stupid copy-and-paste error. Thank you again!