-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add minimal support for 4.x #733
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
665bdc1
Support multirange in the driver
scotttrinh 8e05449
wip Generator running in 4.0 now
scotttrinh 75227d5
Add debug to `Invalid type` error message
scotttrinh 1592963
Add progress messages to edgeql-js
scotttrinh 54f0ee3
Add anyobject uuid
scotttrinh ec953ca
Add `anyobject` to list of reserved keywords
scotttrinh b298991
Add a case for representing `AnyObjectType` as a string
scotttrinh c1579a7
If an argument is an object, it's a match for `anyobject`
scotttrinh 5379b1d
Handle anyobject and re-enable the FTS module
scotttrinh 93ba86c
Remove fts module for older versions
scotttrinh 2e97e5b
Update polymorphic query based on new behavior
scotttrinh 8701cd7
Revert unnecessary array codec changes
scotttrinh 64b388e
Add integration test for multirange
scotttrinh 567d960
Close client in deno multirange test
scotttrinh 1407968
Re-generate errors
scotttrinh 8e38a7d
Return MultiRange as an array
scotttrinh 551ed4b
Account for possible datetime types in Range codecs
scotttrinh c0c7210
Fix Range._incLower default
scotttrinh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
module default { | ||
|
||
type WithMultiRange { | ||
required ranges: multirange<std::int32>; | ||
}; | ||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE MIGRATION m1rlwpc5ikrkb7cvylhbcntglvnanm524yb6si5xlcjk6gd2lczugq | ||
ONTO initial | ||
{ | ||
CREATE TYPE default::WithMultiRange { | ||
CREATE REQUIRED PROPERTY ranges: multirange<std::int32>; | ||
}; | ||
}; |
This file contains 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import type { Client, MultiRange } from "edgedb"; | ||
import e from "./dbschema/edgeql-js"; | ||
import { setupTests, tc, teardownTests } from "./setupTeardown"; | ||
|
||
import type { WithMultiRange } from "./dbschema/interfaces"; | ||
|
||
interface BaseObject { | ||
id: string; | ||
} | ||
interface test_WithMultiRange extends BaseObject { | ||
ranges: MultiRange<number>; | ||
} | ||
|
||
describe("multirange", () => { | ||
let client: Client; | ||
beforeAll(async () => { | ||
const setup = await setupTests(); | ||
({ client } = setup); | ||
}); | ||
|
||
afterAll(async () => { | ||
await teardownTests(client); | ||
}, 10_000); | ||
|
||
test("check generated interfaces", () => { | ||
tc.assert<tc.IsExact<WithMultiRange, test_WithMultiRange>>(true); | ||
}); | ||
|
||
test("inferred return type + literal encoding", async () => { | ||
const query = e.select(e.WithMultiRange, () => ({ | ||
ranges: true, | ||
})); | ||
|
||
const result = await query.run(client); | ||
|
||
tc.assert< | ||
tc.IsExact< | ||
typeof result, | ||
{ | ||
ranges: MultiRange<number>; | ||
}[] | ||
> | ||
>(true); | ||
}); | ||
}); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change reflects the new behavior of 4.x where the parent type's cardinality is considered when using polymorphic queries. In this case,
Person
has a requiredname
, but the query can returnPerson
records that are notHero
s, which would return a empty set name, which is invalid forPerson
.