Skip to content

test: reproduce nested sql bug #439

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

Merged
merged 3 commits into from
Apr 16, 2025
Merged

test: reproduce nested sql bug #439

merged 3 commits into from
Apr 16, 2025

Conversation

mmkal
Copy link
Owner

@mmkal mmkal commented Apr 1, 2025

Re: #438

@caoer first commit 46880bc just adds a test which will fail - this is the bug you found. Second commit will be a fix.

Update: failed as expected, see screenshot below.

image

Fix in 16d94c2 - haven't run the full suite but let's see.

Copy link

vercel bot commented Apr 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
pgkit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 1, 2025 9:47pm

@mmkal mmkal changed the title test: reproduce the bug test: reproduce nested sql bug Apr 1, 2025
@caoer
Copy link
Contributor

caoer commented Apr 2, 2025

ah, I see! this is a clever fix, I will test it out a bit later

@caoer
Copy link
Contributor

caoer commented Apr 2, 2025

hi, @mmkal , I've tested other cases and it works fine. but I have another question here, regarding the MemberType:

export type MemberType = 'text'

it generated code: $2::text[], however, there are other types in the pg. such as:

  • Numeric types (int2, int4, int8, float4, float8, numeric)
  • Text types (text, varchar, char, bpchar)
  • Date/time types (date, timestamp, timestamptz, time, timetz, interval)
  • JSON types (json, jsonb)
  • Network types (inet, cidr, macaddr, macaddr8)
  • Boolean type (bool)
  • UUID type (uuid)
  • Binary data types (bytea, bit, varbit)
  • Geometric types (point, path, polygon, etc.)
  • some specialized types

which end up with:

export type MemberType =
  | 'text'
  | 'bool'
  | 'bytea'
  | 'char'
  | 'name'
  | 'int2'
  | 'int4'
  | 'int8'
  | 'int2vector'
  | 'float4'
  | 'float8'
  | 'numeric'
  | 'regproc'
  | 'regclass'
  | 'regtype'
  | 'regoper'
  | 'regoperator'
  | 'regconfig'
  | 'regdictionary'
  | 'uuid'
  | 'json'
  | 'jsonb'
  | 'xml'
  | 'point'
  | 'lseg'
  | 'path'
  | 'box'
  | 'polygon'
  | 'line'
  | 'cidr'
  | 'inet'
  | 'macaddr'
  | 'macaddr8'
  | 'bit'
  | 'varbit'
  | 'timestamp'
  | 'timestamptz'
  | 'date'
  | 'time'
  | 'timetz'
  | 'interval'
  | 'money'
  | 'oid'
  | 'tid'
  | 'xid'
  | 'cid'
  | 'vector'
  | 'bpchar'
  | 'varchar'
  | 'array'
  | 'abstime'
  | 'reltime'
  | 'tinterval'
  | 'circle'
  | 'tsquery'
  | 'tsvector'

is this what you think can be added?

@caoer
Copy link
Contributor

caoer commented Apr 2, 2025

see: #440

@mmkal mmkal merged commit 1647cad into pgkit Apr 16, 2025
4 checks passed
@mmkal mmkal deleted the nested-sql-fix branch April 16, 2025 13:33
Copy link

github-actions bot commented Jun 6, 2025

Release v0.5.0 addresses this.

Copy link

github-actions bot commented Jun 6, 2025

Release v0.5.0 addresses this.

2 similar comments
Copy link

github-actions bot commented Jun 6, 2025

Release v0.5.0 addresses this.

Copy link

github-actions bot commented Jun 6, 2025

Release v0.5.0 addresses this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants