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

/api/v1/loggers?current=1&pageSize=10 ERROR: column b.id does not exist (SQLSTATE 42703) #148

Open
anggitrestuu opened this issue Jan 6, 2024 · 1 comment

Comments

@anggitrestuu
Copy link

ERROR: column b.id does not exist (SQLSTATE 42703)
[5.345ms] [rows:0] SELECT count(*) FROM logger AS a left join user b on a.user_id=b.id

im using postgres

[Logger]
Debug = true
Level = "debug" # debug/info/warn/error/dpanic/panic/fatal
CallerSkip = 1

[Logger.File]
Enable = false
Path = "data/log/goapigateway.log"
MaxBackups = 20 # Files
MaxSize = 64 # MB

[[Logger.Hooks]]
Enable = true
Level = "info"
Type = "gorm" # gorm
MaxBuffer = 1024
MaxThread = 2

[Logger.Hooks.Options]
Debug = "false"
DBType = "postgres" # sqlite3/mysql/postgres

DSN = "data/goapigateway.db"

DSN = "host=localhost user=postgres password=password dbname=goapigateway port=5432 sslmode=disable TimeZone=Asia/Jakarta"
MaxOpenConns = "16"
MaxIdleConns = "4"
MaxLifetime = "86400"
MaxIdleTime = "7200"

@phidn
Copy link

phidn commented Feb 25, 2024

update internal\mods\sys\dal\logger.dal.go

db = db.Joins(fmt.Sprintf("left join %s b on a.user_id=b.id", new(rbacSchema.User).TableName()))

to

db = db.Joins(fmt.Sprintf("left join \"%s\" b on a.user_id=b.id", new(rbacSchema.User).TableName()))

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

2 participants