Skip to content

Commit

Permalink
fix: test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
dosco committed Jan 1, 2023
1 parent 4dd2b8e commit 8802f31
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
29 changes: 13 additions & 16 deletions core/internal/psql/columns.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,16 @@ func (c *compilerContext) renderJoinColumns(sel *qcode.Select, n int) {

//TODO: log what and why this is being skipped
switch csel.SkipRender {
case qcode.SkipTypeNone:
case qcode.SkipTypeUserNeeded, qcode.SkipTypeBlocked:
c.w.WriteString(`NULL`)
c.alias(csel.FieldName)

if sel.Paging.Cursor {
c.w.WriteString(`, NULL`)
c.alias(sel.FieldName)
}

default:
switch csel.Rel.Type {
case sdata.RelPolymorphic:
c.renderUnionColumn(sel, csel)
Expand All @@ -86,18 +95,6 @@ func (c *compilerContext) renderJoinColumns(sel *qcode.Select, n int) {
c.w.WriteString(csel.FieldName)
c.w.WriteString(`_cursor`)
}
default:
if i != 0 {
c.w.WriteString(", ")
}

c.w.WriteString(`NULL`)
c.alias(csel.FieldName)

if sel.Paging.Cursor {
c.w.WriteString(`, NULL`)
c.alias(sel.FieldName)
}
}
i++
}
Expand All @@ -114,10 +111,10 @@ func (c *compilerContext) renderUnionColumn(sel, csel *qcode.Select) {
c.squoted(usel.Table)
c.w.WriteString(` THEN `)

if usel.SkipRender == qcode.SkipTypeUserNeeded ||
usel.SkipRender == qcode.SkipTypeBlocked {
switch usel.SkipRender {
case qcode.SkipTypeUserNeeded, qcode.SkipTypeBlocked:
c.w.WriteString(`NULL `)
} else {
default:
c.w.WriteString(`__sj_`)
int32String(c.w, usel.ID)
c.w.WriteString(`.json `)
Expand Down
6 changes: 3 additions & 3 deletions core/internal/psql/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ func (co *Compiler) CompileQuery(
c.w.WriteString(`, `)
}

if sel.SkipRender == qcode.SkipTypeUserNeeded ||
sel.SkipRender == qcode.SkipTypeBlocked {
switch sel.SkipRender {
case qcode.SkipTypeUserNeeded, qcode.SkipTypeBlocked:
c.w.WriteString(`'`)
c.w.WriteString(sel.FieldName)
c.w.WriteString(`', NULL`)
Expand All @@ -155,7 +155,7 @@ func (co *Compiler) CompileQuery(
c.w.WriteString(`_cursor', NULL`)
}

} else {
default:
c.w.WriteString(`'`)
c.w.WriteString(sel.FieldName)
c.w.WriteString(`', __sj_`)
Expand Down
Binary file modified wasm/graphjin.wasm
Binary file not shown.

1 comment on commit 8802f31

@vercel
Copy link

@vercel vercel bot commented on 8802f31 Jan 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.