Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Disable schema prefix in generated structs name, eg, SchemaTableName from schema.table_name #3211

Unanswered
Nikola-Milovic asked this question in Q&A
Discussion options

Is it possible to drop the schema from the generated struct without having to manually rename each one?
Eg.

create table app.users (
 id uuid primary key,
 confirmed boolean not null default false,
type AppUser struct {
	ID pgtype.UUID
	Confirmed bool

I understand that there might be conflicts if the schema name is dropped, but I'd deal with that in another way. (by prefixing only in the case of a conflict if possible).

This is especially annoying since the new postgres 15 changes and the move towards using per user schemas, and discouraging the usage of public schema.

My full setup uses SQLC queries with atlas-go for migration generation out of a db schema, not sure if there is a better way of doing this.

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

I have the same problem. Did you find any solution?

You must be logged in to vote
1 reply
Comment options

Just stopped specifying the schema explicitly for now, haven't found a better solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /