Skip to content
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

Address a huge number of TODOs across the codebase #396

Merged
merged 63 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
71c3bea
TODO -> NOTE
benjie Jun 22, 2023
de654cf
Fix parsing of ranges over fancy codecs
benjie Jun 22, 2023
77c03df
Remove a PgResource.configFromCodec call
benjie Jun 22, 2023
ec53f4b
Move resource generation to build time, give codecs executors
benjie Jun 22, 2023
d5de1a4
Address a TODO
benjie Jun 23, 2023
db3aa6e
Move codec-based resource generation to registry construction time
benjie Jun 23, 2023
e5168d7
Do not generate schema entities based on virtual codec resources
benjie Jun 23, 2023
ffb9303
Update snapshots with new resource names
benjie Jun 23, 2023
9398a10
Lint
benjie Jun 23, 2023
d67b3df
Remove another TODO
benjie Jun 23, 2023
01462e3
Remove some TODOs
benjie Jun 23, 2023
776a4ef
Customize error to remove a TODO
benjie Jun 23, 2023
1e75674
Optimize hasMore on pgSelect
benjie Jun 23, 2023
6f111ec
Update plans from Lambda to Access
benjie Jun 23, 2023
e5b58ed
Add cleaner hasMore approach to union too
benjie Jun 23, 2023
e8ce023
Make union more unique by using an (optional) name
benjie Jun 23, 2023
4a2ccb1
Update snapshots with new cursors and aliases
benjie Jun 23, 2023
9c2a6c5
Don't cast to text then back to json
benjie Jun 23, 2023
b5b6431
alreadyEncoded not needed for pgSelect
benjie Jun 23, 2023
0b2e2b6
Validate column types align when ordering on union
benjie Jun 23, 2023
7615022
Handle nullability in ordering
benjie Jun 23, 2023
6828fd2
Copy nullable ordering logic over to pgSelect
benjie Jun 23, 2023
cea2f69
Indeed, it is not needed.
benjie Jun 26, 2023
f1caff6
Codecs should throw if data is invalid
benjie Jun 26, 2023
104c852
Write manual async generator to enable early return/throw
benjie Jun 26, 2023
2029673
Demote TODO to PERF
benjie Jun 26, 2023
e7fa19d
Add more consistency checks
benjie Jun 26, 2023
b1b6610
Fix hack using new logic
benjie Jun 26, 2023
5227e72
Don't order queries when they are unique
benjie Jun 26, 2023
7df1972
Fix mutation edge cursors
benjie Jun 27, 2023
495428a
Remove unnecessary order by clauses
benjie Jun 27, 2023
cfb5afd
Remove redundant codec
benjie Jun 27, 2023
2c09556
Demote TODO to PERF
benjie Jun 27, 2023
f6538af
Assert that hookArgs is only called once
benjie Jun 27, 2023
2974ab1
Centralize hasItemPlan
benjie Jun 27, 2023
dda79bd
Demote TODO to TYPES
benjie Jun 27, 2023
bc0eedb
Move TODO to LOGGING
benjie Jun 27, 2023
d977878
Remove commented code
benjie Jun 27, 2023
fca675d
TODO -> LOGGING
benjie Jun 27, 2023
c7527bc
Expand TODO with more details
benjie Jun 27, 2023
e09a48a
Remove a FIXME, assert that it has already been handled
benjie Jun 27, 2023
77c1e69
Lint
benjie Jun 27, 2023
48b5ccd
Forbid creating steps during deduplicate
benjie Jun 27, 2023
07ccf9b
Already renamed?
benjie Jun 27, 2023
a43a663
Move from 'HACK' to 'TEST' with longer explanation
benjie Jun 27, 2023
1ce565a
Creating new steps during deduplicate is explicitly not forbidden
benjie Jun 27, 2023
55e95f8
Tidyup is more of a performance concern
benjie Jun 27, 2023
60c7a6c
Not sure about this, leave it as a note
benjie Jun 27, 2023
14988a0
Move metaByMetaKey to live on bucket rather than requestContext
benjie Jun 27, 2023
f0cd550
Lint
benjie Jun 27, 2023
00ec6af
https://github.com/benjie/postgraphile-private/issues/395
benjie Jun 28, 2023
c1adcdf
No action necessary right now
benjie Jun 28, 2023
8587b57
Reclassify some TODOs
benjie Jun 28, 2023
9f2507e
docs(changeset): Codecs can now (optionally) have executors associate…
benjie Jun 28, 2023
6595083
docs(changeset): List and range codecs now use the underlying codec t…
benjie Jun 28, 2023
56b5229
docs(changeset): pgUnionAll can now specify a name, making the SQL an…
benjie Jun 28, 2023
b5eb7c4
docs(changeset): Cursor pagination over nullable columns _should_ now…
benjie Jun 28, 2023
b66d250
docs(changeset): hasNextPage (via hasMore) now uses an access plan ra…
benjie Jun 28, 2023
3caaced
docs(changeset): When fetching a single row, an `ORDER BY` clause wil…
benjie Jun 28, 2023
17fe531
docs(changeset): pgUnionAll uses a slightly more optimal SQL (where J…
benjie Jun 28, 2023
e8c81cd
docs(changeset): (Internal) metaByMetaKey is now stored onto the buck…
benjie Jun 28, 2023
9feb769
docs(changeset): Improve debugging message when new steps are created…
benjie Jun 28, 2023
7573bf3
docs(changeset): Address a decent number of TODO/FIXME/etc comments i…
benjie Jun 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/clean-seahorses-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@dataplan/pg": patch
---

List and range codecs now use the underlying codec to parse values from
Postgres.
8 changes: 8 additions & 0 deletions .changeset/fair-eagles-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"graphile-build-pg": patch
"postgraphile": patch
"@dataplan/pg": patch
---

pgUnionAll uses a slightly more optimal SQL (where JSON isn't cast to `::text`
and then back to `::json`)
5 changes: 5 additions & 0 deletions .changeset/honest-bottles-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@dataplan/pg": patch
---

pgUnionAll can now specify a name, making the SQL and query plan easier to read.
6 changes: 6 additions & 0 deletions .changeset/odd-planes-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"grafast": patch
---

Improve debugging message when new steps are created at a time when doing so is
forbidden.
8 changes: 8 additions & 0 deletions .changeset/proud-insects-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"graphile-build-pg": patch
"postgraphile": patch
"@dataplan/pg": patch
---

Cursor pagination over nullable columns _should_ now work, although it is
untested.
9 changes: 9 additions & 0 deletions .changeset/serious-terms-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"graphile-build-pg": patch
"graphile-utils": patch
"postgraphile": patch
"@dataplan/pg": patch
"grafast": patch
---

Address a decent number of TODO/FIXME/etc comments in the codebase.
7 changes: 7 additions & 0 deletions .changeset/tender-eggs-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"graphile-build-pg": patch
"postgraphile": patch
"@dataplan/pg": patch
---

hasNextPage (via hasMore) now uses an access plan rather than a lambda plan.
7 changes: 7 additions & 0 deletions .changeset/violet-drinks-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"grafast": patch
---

(Internal) metaByMetaKey is now stored onto the bucket rather than the request
context, this allows running steps inside special buckets (subscriptions,
mutations) to run with a clean cache.
7 changes: 7 additions & 0 deletions .changeset/weak-stingrays-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"graphile-build-pg": patch
"postgraphile": patch
"@dataplan/pg": patch
---

When fetching a single row, an `ORDER BY` clause will no longer be added.
10 changes: 10 additions & 0 deletions .changeset/wet-snakes-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"graphile-build-pg": patch
"@dataplan/pg": patch
---

Codecs can now (optionally) have executors associated (typically useful for
record codecs); so we've eradicated runtime resource definition for columns that
use composite types (or lists thereof) - all composite types accessible from
attributes are now guaranteed to have a table-like resource generated in the
registry.
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ lateral (
) and (
__relational_items__."id" = __relational_items_identifiers__."id0"
)
order by __relational_items__."id" asc
) as __relational_items_result__;

select __relational_items_result__.*
Expand All @@ -41,7 +40,6 @@ lateral (
) and (
__relational_items__."id" = __relational_items_identifiers__."id0"
)
order by __relational_items__."id" asc
) as __relational_items_result__;

select __relational_items_result__.*
Expand All @@ -58,7 +56,6 @@ lateral (
) and (
__relational_items__."id" = __relational_items_identifiers__."id0"
)
order by __relational_items__."id" asc
) as __relational_items_result__;

select __relational_posts_result__.*
Expand All @@ -77,7 +74,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

select __relational_posts_result__.*
Expand All @@ -96,7 +92,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

insert into interfaces_and_unions.relational_items as __relational_items__ ("type", "author_id") values ($1::interfaces_and_unions.item_type, $2::"int4") returning
Expand All @@ -119,7 +114,6 @@ lateral (
) and (
__relational_items__."id" = __relational_items_identifiers__."id0"
)
order by __relational_items__."id" asc
) as __relational_items_result__;

select __relational_items_result__.*
Expand All @@ -136,7 +130,6 @@ lateral (
) and (
__relational_items__."id" = __relational_items_identifiers__."id0"
)
order by __relational_items__."id" asc
) as __relational_items_result__;

select __relational_items_result__.*
Expand All @@ -153,7 +146,6 @@ lateral (
) and (
__relational_items__."id" = __relational_items_identifiers__."id0"
)
order by __relational_items__."id" asc
) as __relational_items_result__;

select __relational_posts_result__.*
Expand All @@ -172,7 +164,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

select __relational_posts_result__.*
Expand All @@ -191,7 +182,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

select __relational_posts_result__.*
Expand All @@ -210,5 +200,4 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ lateral (
) and (
__relational_items__."id" = __relational_items_identifiers__."id0"
)
order by __relational_items__."id" asc
) as __relational_items_result__;

select __relational_items_result__.*
Expand All @@ -41,7 +40,6 @@ lateral (
) and (
__relational_items__."id" = __relational_items_identifiers__."id0"
)
order by __relational_items__."id" asc
) as __relational_items_result__;

select __relational_items_result__.*
Expand All @@ -58,7 +56,6 @@ lateral (
) and (
__relational_items__."id" = __relational_items_identifiers__."id0"
)
order by __relational_items__."id" asc
) as __relational_items_result__;

select __relational_posts_result__.*
Expand All @@ -77,7 +74,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

select __relational_posts_result__.*
Expand All @@ -96,7 +92,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

insert into interfaces_and_unions.relational_items as __relational_items__ ("type", "author_id") values ($1::interfaces_and_unions.item_type, $2::"int4") returning
Expand All @@ -119,7 +114,6 @@ lateral (
) and (
__relational_items__."id" = __relational_items_identifiers__."id0"
)
order by __relational_items__."id" asc
) as __relational_items_result__;

select __relational_items_result__.*
Expand All @@ -136,7 +130,6 @@ lateral (
) and (
__relational_items__."id" = __relational_items_identifiers__."id0"
)
order by __relational_items__."id" asc
) as __relational_items_result__;

select __relational_items_result__.*
Expand All @@ -153,7 +146,6 @@ lateral (
) and (
__relational_items__."id" = __relational_items_identifiers__."id0"
)
order by __relational_items__."id" asc
) as __relational_items_result__;

select __relational_posts_result__.*
Expand All @@ -172,7 +164,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

select __relational_posts_result__.*
Expand All @@ -191,7 +182,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

select __relational_posts_result__.*
Expand All @@ -210,5 +200,4 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

insert into interfaces_and_unions.relational_items as __relational_items__ ("type", "author_id") values ($1::interfaces_and_unions.item_type, $2::"int4") returning
Expand All @@ -47,7 +46,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

insert into interfaces_and_unions.relational_items as __relational_items__ ("type", "author_id") values ($1::interfaces_and_unions.item_type, $2::"int4") returning
Expand All @@ -73,7 +71,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

insert into interfaces_and_unions.relational_items as __relational_items__ ("type", "author_id") values ($1::interfaces_and_unions.item_type, $2::"int4") returning
Expand All @@ -99,5 +96,4 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

insert into interfaces_and_unions.relational_items as __relational_items__ ("type", "author_id") values ($1::interfaces_and_unions.item_type, $2::"int4") returning
Expand All @@ -47,7 +46,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

insert into interfaces_and_unions.relational_items as __relational_items__ ("type", "author_id") values ($1::interfaces_and_unions.item_type, $2::"int4") returning
Expand All @@ -73,7 +71,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

insert into interfaces_and_unions.relational_items as __relational_items__ ("type", "author_id") values ($1::interfaces_and_unions.item_type, $2::"int4") returning
Expand All @@ -99,5 +96,4 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;

select __people_result__.*
Expand All @@ -45,5 +44,4 @@ lateral (
) and (
__people__."person_id" = __people_identifiers__."id0"
)
order by __people__."person_id" asc
) as __people_result__;
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ lateral (
) and (
__relational_posts__."id" = __relational_posts_identifiers__."id0"
)
order by __relational_posts__."id" asc
) as __relational_posts_result__;
Loading