Skip to content

Commit

Permalink
add method to retrieve alias from view struct
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz_skupiewski committed Jan 9, 2025
1 parent 91f9bef commit 8670a1c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dialect/mysql/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ func (v *View[T, Tslice]) NameAs() bob.Expression {
return v.Name().As(v.alias)
}

func (v *View[T, Tslice]) Alias() string {
return v.alias
}

// Returns a column list
func (v *View[T, Tslice]) Columns() orm.Columns {
// get the schema
Expand Down
4 changes: 4 additions & 0 deletions dialect/psql/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func (v *View[T, Tslice]) NameAs() bob.Expression {
return v.Name().As(v.alias)
}

func (v *View[T, Tslice]) Alias() string {
return v.alias
}

// Returns a column list
func (v *View[T, Tslice]) Columns() orm.Columns {
// get the schema
Expand Down
4 changes: 4 additions & 0 deletions dialect/sqlite/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func (v *View[T, Tslice]) NameAs() bob.Expression {
return v.Name().As(v.alias)
}

func (v *View[T, Tslice]) Alias() string {
return v.alias
}

// Returns a column list
func (v *View[T, Tslice]) Columns() orm.Columns {
// get the schema
Expand Down

0 comments on commit 8670a1c

Please sign in to comment.