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

嵌套类型不能正确设值 #87

Open
0xleizhang opened this issue Dec 16, 2020 · 2 comments
Open

嵌套类型不能正确设值 #87

0xleizhang opened this issue Dec 16, 2020 · 2 comments

Comments

@0xleizhang
Copy link

image

select  
		a.context,a.create_time,
		b.avatar as "creator.avatar",b.avatar as creator_avatar
		from t_comment a 
		left join t_user b on a.create_by = b.id
		where a.link_id in (?)

为了方便复现以下是
建表SQL:
CREATE TABLE IF NOT EXISTS "t_comment" ( "id" SERIAL PRIMARY KEY NOT NULL, "link_id" INTEGER NULL, "context" VARCHAR(240) NULL, "score" INTEGER DEFAULT 0 NULL, "agree" INTEGER DEFAULT 0 NULL, "disagree" INTEGER DEFAULT 0 NULL, "create_by" INTEGER NULL, "create_time" TIMESTAMP NULL, "update_time" TIMESTAMP NULL, "delete_time" TIMESTAMP NULL )CREATE TABLE IF NOT EXISTS "t_user" ( "id" SERIAL NOT NULL primary key, "name" VARCHAR(140) NULL, "avatar" varchar(380) null, "score" int NULL, "create_time" timestamp NULL, "update_time" timestamp NULL, "delete_time" timestamp NULL );

@0xleizhang
Copy link
Author

同样的struct结构SQL改成这样就能设值:

select  
		a.context,a.create_time,
		b.avatar 
		from t_comment a 
		left join t_user b on a.create_by = b.id
		where a.link_id in (?)

@0xleizhang
Copy link
Author

嵌套类型用extends 能够正常的查询设置。但是插入的时候会出错

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

No branches or pull requests

1 participant