GetCtx returns the context for current Model. It returns `context.Background()` is there's no context previously set.
()
| 221 | // GetCtx returns the context for current Model. |
| 222 | // It returns `context.Background()` is there's no context previously set. |
| 223 | func (m *Model) GetCtx() context.Context { |
| 224 | if m.tx != nil && m.tx.GetCtx() != nil { |
| 225 | return m.tx.GetCtx() |
| 226 | } |
| 227 | return m.db.GetCtx() |
| 228 | } |
| 229 | |
| 230 | // As sets an alias name for current table. |
| 231 | func (m *Model) As(as string) *Model { |
no test coverage detected