mirror of https://github.com/lqs/sqlingo
Fix nil pointer dereference in table.GetSQL
Add nil check for scope.Database before accessing dialect, consistent with the pattern used in field.go and expression.go. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
333f52e702
commit
6ea08e79aa
6
table.go
6
table.go
|
|
@ -24,7 +24,11 @@ func (t table) GetName() string {
|
|||
}
|
||||
|
||||
func (t table) GetSQL(scope scope) string {
|
||||
return t.sqlDialects[scope.Database.dialect]
|
||||
dialect := dialectUnknown
|
||||
if scope.Database != nil {
|
||||
dialect = scope.Database.dialect
|
||||
}
|
||||
return t.sqlDialects[dialect]
|
||||
}
|
||||
|
||||
func (t table) getOperatorPriority() int {
|
||||
|
|
|
|||
Loading…
Reference in New Issue