MySQL linter errors.
This commit is contained in:
parent
5e76355275
commit
46a3dc7dfb
31 changed files with 254 additions and 136 deletions
|
|
@ -150,7 +150,7 @@ func (o *ClauseOffset) Serialize(statementType StatementType, out *SqlBuilder) {
|
|||
}
|
||||
|
||||
type ClauseFor struct {
|
||||
Lock SelectLock
|
||||
Lock RowLock
|
||||
}
|
||||
|
||||
func (f *ClauseFor) Serialize(statementType StatementType, out *SqlBuilder) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
package jet
|
||||
|
||||
// Column is common column interface for all types of columns.
|
||||
type Column interface {
|
||||
Name() string
|
||||
TableName() string
|
||||
|
|
@ -11,7 +12,6 @@ type Column interface {
|
|||
defaultAlias() string
|
||||
}
|
||||
|
||||
// Column is common column interface for all types of columns.
|
||||
type ColumnExpression interface {
|
||||
Column
|
||||
Expression
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package jet
|
||||
|
||||
// Projection is interface for all projection types. Types that can be part of, for instance SELECT clause.
|
||||
type Projection interface {
|
||||
serializeForProjection(statement StatementType, out *SqlBuilder)
|
||||
fromImpl(subQuery SelectTable) Projection
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
package jet
|
||||
|
||||
// SelectLock is interface for SELECT statement locks
|
||||
type SelectLock interface {
|
||||
// RowLock is interface for SELECT statement row lock types
|
||||
type RowLock interface {
|
||||
Serializer
|
||||
|
||||
NOWAIT() SelectLock
|
||||
SKIP_LOCKED() SelectLock
|
||||
NOWAIT() RowLock
|
||||
SKIP_LOCKED() RowLock
|
||||
}
|
||||
|
||||
type selectLockImpl struct {
|
||||
|
|
@ -13,22 +13,22 @@ type selectLockImpl struct {
|
|||
noWait, skipLocked bool
|
||||
}
|
||||
|
||||
func NewSelectLock(name string) func() SelectLock {
|
||||
return func() SelectLock {
|
||||
func NewSelectLock(name string) func() RowLock {
|
||||
return func() RowLock {
|
||||
return newSelectLock(name)
|
||||
}
|
||||
}
|
||||
|
||||
func newSelectLock(lockStrength string) SelectLock {
|
||||
func newSelectLock(lockStrength string) RowLock {
|
||||
return &selectLockImpl{lockStrength: lockStrength}
|
||||
}
|
||||
|
||||
func (s *selectLockImpl) NOWAIT() SelectLock {
|
||||
func (s *selectLockImpl) NOWAIT() RowLock {
|
||||
s.noWait = true
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *selectLockImpl) SKIP_LOCKED() SelectLock {
|
||||
func (s *selectLockImpl) SKIP_LOCKED() RowLock {
|
||||
s.skipLocked = true
|
||||
return s
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ import (
|
|||
|
||||
type SerializerTable interface {
|
||||
Serializer
|
||||
TableInterface
|
||||
Table
|
||||
}
|
||||
|
||||
type TableInterface interface {
|
||||
type Table interface {
|
||||
columns() []Column
|
||||
SchemaName() string
|
||||
TableName() string
|
||||
|
|
@ -111,7 +111,7 @@ func NewJoinTableImpl(lhs Serializer, rhs Serializer, joinType JoinType, onCondi
|
|||
}
|
||||
|
||||
func (t *JoinTableImpl) SchemaName() string {
|
||||
if table, ok := t.lhs.(TableInterface); ok {
|
||||
if table, ok := t.lhs.(Table); ok {
|
||||
return table.SchemaName()
|
||||
}
|
||||
return ""
|
||||
|
|
@ -124,10 +124,10 @@ func (t *JoinTableImpl) TableName() string {
|
|||
func (t *JoinTableImpl) Columns() []Column {
|
||||
var ret []Column
|
||||
|
||||
if lhsTable, ok := t.lhs.(TableInterface); ok {
|
||||
if lhsTable, ok := t.lhs.(Table); ok {
|
||||
ret = append(ret, lhsTable.columns()...)
|
||||
}
|
||||
if rhsTable, ok := t.rhs.(TableInterface); ok {
|
||||
if rhsTable, ok := t.rhs.(Table); ok {
|
||||
ret = append(ret, rhsTable.columns()...)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue