Describe the bug
It seems from a previous issue that outer joins should be recognized as nullable, but in ^2.3.0 I cannot seem to replicate this behaviour.
Test casetables.sql:
-- CreateTable
CREATE TABLE "A" (
"id" SERIAL NOT NULL,
"aStr" TEXT NOT NULL,
CONSTRAINT "A_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "B" (
"aId" INTEGER NOT NULL,
"bStr" TEXT NOT NULL,
CONSTRAINT "B_pkey" PRIMARY KEY ("aId")
);
-- AddForeignKey
ALTER TABLE "B" ADD CONSTRAINT "B_aId_fkey" FOREIGN KEY ("aId") REFERENCES "A"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
test.sql:
/* @name get */
SELECT a.*, b."bStr" FROM "A" a
LEFT JOIN public."B" b on a.id = b."aId";
Describe the bug It seems from a previous issue that outer joins should be recognized as nullable, but in
^2.3.0
I cannot seem to replicate this behaviour.Test case
tables.sql
:test.sql
:The generated type for this query is:
But I'd expect the following: