-
Notifications
You must be signed in to change notification settings - Fork 690
Fix UNIQUE constraint support for JSON properties and expressions #2193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
…ss in CREATE UNIQUE INDEX Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
|
Run yarn test-format-all {2:$V1,3:1857,4:$V2,5:$V3,132:$V76,377:1905},o($VK3,[2,528]),{230:[1,1907],384:1906},{343:[1,1908]},{74:$V86,78:[1,1909]},o($VK3,[2,531]),{340:[1,1910]},{385:[1,1911]},o($Va6,[2,529]),{385:[1,1912]},{386:[1,1913]},{386:[1,1914]},{230:[2,532]},o($VK3,[2,533])], |
…to test925, format code Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
Ran yarn format-all and yarn jison. All files formatted correctly. Commit: 121fb2e Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This comment has been minimized.
This comment has been minimized.
|
…ns, use assert.throws, fix VALUE reserved word Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
|
... Fixed parse error by replacing reserved word Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Description
UNIQUE constraints failed with JSON property accessors (
name->test,name.test) and CREATE UNIQUE INDEX didn't enforce uniqueness at insert time.Changes
Parser (
alasqlparser.jison)UniqueKeyproduction to acceptOrderExpressionsListinstead ofColumnsList, enabling expression support in UNIQUE constraints (similar to CREATE INDEX behavior)Table Constraints (
60createtable.js)expr.expression.toJS()instead of treating them as literal column namesIndex Creation (
65createindex.js)table.ukarray for insert-time validationtable.uniqshash properly usingrightfnevaluationuktouniqueConstraintfor better code clarityTests
test925.jswith comprehensive test coverage:assert.throws()for cleaner codetest122.jsto unskip test 2 (validates unique index enforcement), fixed test 4 to properly test that normal indexes allow duplicate values, and converted to arrow functionsExample
Fixes #925
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.