Open nkr-404-NotFound opened 1 year ago
use a.col in sql in select section not from section , found that table name not replaces by sub table name
in join sql , here stmt.fromItems's type is func (JoinClause) source(), not func (TableName) source()
so currently , no join sql can be processed correctly
We've done it couple years ago. check it here: https://github.com/go-gorm/sharding/pull/15 This repo aims to support both PG and MySQL. So it cannot be merged.
I just looked at the before mentioned PR and started looking for alternatives to sqlparser, but I can't find one actively maintained. Also I just looked into gorm and found gorm to build everything itself. Do I miss/not find something?
I just looked at the before mentioned PR and started looking for alternatives to sqlparser, but I can't find one actively maintained. Also I just looked into gorm and found gorm to build everything itself. Do I miss/not find something?
Just try https://github.com/pingcap/parser . BTW I think a SQL parser doesn't need to be updated frequently. It should just remain as stable as possible.
Your Question
in project when i use gorm sharding and my SQL contains JOIN, like A.col1, B.col2 the query will fail. the query trys to find the main table instead of sub table
The document you expected this should be explained
Expected answer
any help ? thanks