Skip to content

Commit

Permalink
chore(query): rename to setModel
Browse files Browse the repository at this point in the history
  • Loading branch information
zekth committed Sep 7, 2022
1 parent 3516802 commit 5de81ff
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions query_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ func (q *baseQuery) setConn(db IConn) {
}
}

// TODO: rename to setModel
func (q *baseQuery) setTableModel(modeli interface{}) {
func (q *baseQuery) setModel(modeli interface{}) {
model, err := newSingleModel(q.db, modeli)
if err != nil {
q.setErr(err)
Expand Down
2 changes: 1 addition & 1 deletion query_column_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (q *AddColumnQuery) Conn(db IConn) *AddColumnQuery {
}

func (q *AddColumnQuery) Model(model interface{}) *AddColumnQuery {
q.setTableModel(model)
q.setModel(model)
return q
}

Expand Down
2 changes: 1 addition & 1 deletion query_column_drop.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (q *DropColumnQuery) Conn(db IConn) *DropColumnQuery {
}

func (q *DropColumnQuery) Model(model interface{}) *DropColumnQuery {
q.setTableModel(model)
q.setModel(model)
return q
}

Expand Down
2 changes: 1 addition & 1 deletion query_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (q *DeleteQuery) Conn(db IConn) *DeleteQuery {
}

func (q *DeleteQuery) Model(model interface{}) *DeleteQuery {
q.setTableModel(model)
q.setModel(model)
return q
}

Expand Down
2 changes: 1 addition & 1 deletion query_index_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (q *CreateIndexQuery) Conn(db IConn) *CreateIndexQuery {
}

func (q *CreateIndexQuery) Model(model interface{}) *CreateIndexQuery {
q.setTableModel(model)
q.setModel(model)
return q
}

Expand Down
2 changes: 1 addition & 1 deletion query_index_drop.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (q *DropIndexQuery) Conn(db IConn) *DropIndexQuery {
}

func (q *DropIndexQuery) Model(model interface{}) *DropIndexQuery {
q.setTableModel(model)
q.setModel(model)
return q
}

Expand Down
2 changes: 1 addition & 1 deletion query_insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (q *InsertQuery) Conn(db IConn) *InsertQuery {
}

func (q *InsertQuery) Model(model interface{}) *InsertQuery {
q.setTableModel(model)
q.setModel(model)
return q
}

Expand Down
2 changes: 1 addition & 1 deletion query_select.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (q *SelectQuery) Conn(db IConn) *SelectQuery {
}

func (q *SelectQuery) Model(model interface{}) *SelectQuery {
q.setTableModel(model)
q.setModel(model)
return q
}

Expand Down
2 changes: 1 addition & 1 deletion query_table_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (q *CreateTableQuery) Conn(db IConn) *CreateTableQuery {
}

func (q *CreateTableQuery) Model(model interface{}) *CreateTableQuery {
q.setTableModel(model)
q.setModel(model)
return q
}

Expand Down
2 changes: 1 addition & 1 deletion query_table_drop.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (q *DropTableQuery) Conn(db IConn) *DropTableQuery {
}

func (q *DropTableQuery) Model(model interface{}) *DropTableQuery {
q.setTableModel(model)
q.setModel(model)
return q
}

Expand Down
2 changes: 1 addition & 1 deletion query_table_truncate.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (q *TruncateTableQuery) Conn(db IConn) *TruncateTableQuery {
}

func (q *TruncateTableQuery) Model(model interface{}) *TruncateTableQuery {
q.setTableModel(model)
q.setModel(model)
return q
}

Expand Down
2 changes: 1 addition & 1 deletion query_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (q *UpdateQuery) Conn(db IConn) *UpdateQuery {
}

func (q *UpdateQuery) Model(model interface{}) *UpdateQuery {
q.setTableModel(model)
q.setModel(model)
return q
}

Expand Down
2 changes: 1 addition & 1 deletion query_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func NewValuesQuery(db *DB, model interface{}) *ValuesQuery {
conn: db.DB,
},
}
q.setTableModel(model)
q.setModel(model)
return q
}

Expand Down

0 comments on commit 5de81ff

Please sign in to comment.