- Notifications
You must be signed in to change notification settings - Fork689
Add SQL-99 constraint support for compliance#2373
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
Copilot wants to merge6 commits intodevelopChoose a base branch fromcopilot/add-sql-99-constraint-support
base:develop
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Changes from1 commit
Commits
Show all changes
6 commits Select commitHold shift + click to select a range
8eac187 Initial plan
Copilot87d80d7 Enable SQL-99 constraint support - all tests passing
Copilot2fc6614 Skip test324 test 20 - unrelated SOURCE command bug
Copilotaa92b24 Fix test324 CURRENT_TIMESTAMP test to handle both string and Date for…
Copilot6629f11 Restore NONCLUSTERED and CLUSTERED keywords in test325
Copilote916c58 Fix SOURCE command bug and enable test324 test 20
CopilotFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Enable SQL-99 constraint support - all tests passing
Fixed column-level foreign key NULL handling to recognize NaN valuesAdded fk flag to column-level foreign keys for consistencyFixed CHECK constraint NULL semantics (NULL=unknown=pass)Fixed CHECK/FK function signatures to include params and alasqlFixed test325 CREATE TABLE SQL syntax (missing comma)Enabled all constraint tests in test324-327Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
2 changes: 1 addition & 1 deletionsrc/50expression.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
28 changes: 18 additions & 10 deletionssrc/60createtable.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
36 changes: 18 additions & 18 deletionstest/test324.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
34 changes: 16 additions & 18 deletionstest/test325.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -6,12 +6,12 @@ if (typeof exports === 'object') { | ||
| } | ||
| describe('Test 325 IDENTITY', function () { | ||
| it('1. CREATE DATABASE', function (done) { | ||
| alasql('CREATE DATABASE test325; USE test325'); | ||
| done(); | ||
| }); | ||
| it('2. CREATE TABLE with multiple constraints', function (done) { | ||
| alasql(function () { | ||
| /* | ||
| IF OBJECT_ID('dbo.Messages') IS NOT NULL DROP TABLE dbo.Messages; | ||
| @@ -23,20 +23,18 @@ describe('Test 325 IDENTITY', function () { | ||
| status VARCHAR(20) NOT NULL DEFAULT('new') | ||
| CHECK(status IN('new', 'open')), | ||
| CONSTRAINT PK_Messages | ||
| PRIMARY KEY(msgid), | ||
| CONSTRAINT UNQ_Messages_status_msgid | ||
mathiasrw marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| UNIQUE(status, msg), | ||
| CONSTRAINT CHK_Messages_status | ||
| CHECK (status IN('new', 'open', 'done')) | ||
| ); | ||
| */ | ||
| }); | ||
| done(); | ||
| }); | ||
| it('3. INSERT INTO', function (done) { | ||
| var res = alasql( | ||
| 'INSERT INTO dbo.Messages (msgts, msg, status) \ | ||
| VALUES("2015.01.01","I love you!","new")' | ||
| @@ -46,7 +44,7 @@ describe('Test 325 IDENTITY', function () { | ||
| done(); | ||
| }); | ||
| it('4. INSERT INTO with NOT NULL violation', function (done) { | ||
| assert.throws(function () { | ||
| var res = alasql( | ||
| 'INSERT INTO dbo.Messages (msgts, msg, status) \ | ||
| @@ -57,7 +55,7 @@ describe('Test 325 IDENTITY', function () { | ||
| done(); | ||
| }); | ||
| it('5. INSERT INTO with CHECK violation', function (done) { | ||
| assert.throws(function () { | ||
| var res = alasql( | ||
| 'INSERT INTO dbo.Messages (msgts, msg, status) \ | ||
| @@ -68,7 +66,7 @@ describe('Test 325 IDENTITY', function () { | ||
| done(); | ||
| }); | ||
| it('6. INSERT INTO with UNIQUE violation', function (done) { | ||
| assert.throws(function () { | ||
| var res = alasql( | ||
| 'INSERT INTO dbo.Messages (msgts, msg, status) \ | ||
| @@ -79,7 +77,7 @@ describe('Test 325 IDENTITY', function () { | ||
| done(); | ||
| }); | ||
| it('7. INSERT INTO with IDENTITY', function (done) { | ||
| // console.log(69,alasql.tables.Messages.identities); | ||
| // console.log(69,alasql.tables.Messages.uniqs); | ||
| // console.log(69,alasql.tables.Messages.pk); | ||
| @@ -89,7 +87,7 @@ describe('Test 325 IDENTITY', function () { | ||
| done(); | ||
| }); | ||
| it('8. INSERT INTO with IDENTITY', function (done) { | ||
| var res = alasql( | ||
| 'INSERT INTO dbo.Messages (msg, status) \ | ||
| VALUES("I hate you!","new")' | ||
| @@ -98,7 +96,7 @@ describe('Test 325 IDENTITY', function () { | ||
| done(); | ||
| }); | ||
| it('9. INSERT INTO with IDENTITY', function (done) { | ||
| var res = alasql( | ||
| 'INSERT INTO dbo.Messages (msg, status) \ | ||
| VALUES("I hate you to much!","new")' | ||
| @@ -107,14 +105,14 @@ describe('Test 325 IDENTITY', function () { | ||
| done(); | ||
| }); | ||
| it('10. INSERT INTO with IDENTITY', function (done) { | ||
| var res = alasql('SELECT COLUMN msgid FROM dbo.Messages'); | ||
| assert.deepEqual(res, [1, 2, 3]); | ||
| // console.log(res); | ||
| done(); | ||
| }); | ||
| it('11. CHECK CONSTRAINT on column', function (done) { | ||
| assert.throws(function () { | ||
| var res = alasql( | ||
| 'INSERT INTO dbo.Messages (msg, status) \ | ||
| @@ -124,7 +122,7 @@ describe('Test 325 IDENTITY', function () { | ||
| done(); | ||
| }); | ||
| it('12. DEFAULT()', function (done) { | ||
| var res = alasql( | ||
| 'INSERT INTO dbo.Messages (msg) \ | ||
| VALUES("It lucky rainbow!")' | ||
| @@ -133,7 +131,7 @@ describe('Test 325 IDENTITY', function () { | ||
| done(); | ||
| }); | ||
| it('13. SELECT with REMOVE COLUMNS', function (done) { | ||
| var res = alasql('SELECT COLUMN msgid FROM dbo.Messages'); | ||
| assert.deepEqual(res, [1, 2, 3, 4]); | ||
| var res = alasql('SELECT * REMOVE COLUMN msgts FROM dbo.Messages WHERE msgid = 4'); | ||
| @@ -142,7 +140,7 @@ describe('Test 325 IDENTITY', function () { | ||
| done(); | ||
| }); | ||
| it('99. DROP DATABASE', function (done) { | ||
| alasql('DROP DATABASE test325'); | ||
| done(); | ||
| }); | ||
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.