Skip to content

Commit

Permalink
readme: fix AsColumn method name in configuration examples
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitrii Aleksandrov <[email protected]>
  • Loading branch information
Insei committed Feb 3, 2025
1 parent feabb5d commit 5d06586
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ func main() {
DB(db).
Table("tests").
Columns(func(m *test, columns *gerpo.ColumnBuilder[test]) {
columns.Field(&m.ID).Column().WithUpdateProtection()
columns.Field(&m.CreatedAt).Column().WithUpdateProtection()
columns.Field(&m.UpdatedAt).Column().WithInsertProtection()
columns.Field(&m.Name).Column()
columns.Field(&m.Age).Column()
columns.Field(&m.ID).AsColumn().WithUpdateProtection()
columns.Field(&m.CreatedAt).AsColumn().WithUpdateProtection()
columns.Field(&m.UpdatedAt).AsColumn().WithInsertProtection()
columns.Field(&m.Name).AsColumn()
columns.Field(&m.Age).AsColumn()
}).
Build()

Expand Down Expand Up @@ -105,12 +105,12 @@ func main() {
DB(db).
Table("tests").
Columns(func(m *test, columns *gerpo.ColumnBuilder[test]) {
columns.Field(&m.ID).Column().WithUpdateProtection()
columns.Field(&m.CreatedAt).Column().WithUpdateProtection()
columns.Field(&m.UpdatedAt).Column().WithInsertProtection()
columns.Field(&m.Name).Column()
columns.Field(&m.Age).Column()
columns.Field(&m.Joined).Column().WithTable("joined_table")
columns.Field(&m.ID).AsColumn().WithUpdateProtection()
columns.Field(&m.CreatedAt).AsColumn().WithUpdateProtection()
columns.Field(&m.UpdatedAt).AsColumn().WithInsertProtection()
columns.Field(&m.Name).AsColumn()
columns.Field(&m.Age).AsColumn()
columns.Field(&m.Joined).AsColumn().WithTable("joined_table")
}).
WithQuery(func(m *test, h query.PersistentHelper[test]) {
h.LeftJoin(func(ctx context.Context) string {
Expand Down Expand Up @@ -148,12 +148,12 @@ func main() {
DB(db).
Table("tests").
Columns(func(m *test, columns *gerpo.ColumnBuilder[test]) {
columns.Field(&m.ID).Column().WithUpdateProtection()
columns.Field(&m.CreatedAt).Column().WithUpdateProtection()
columns.Field(&m.UpdatedAt).Column().WithInsertProtection()
columns.Field(&m.Name).Column()
columns.Field(&m.Age).Column()
columns.Field(&m.DeletedAt).Column().WithInsertProtection() // configure soft deletion field/column
columns.Field(&m.ID).AsColumn().WithUpdateProtection()
columns.Field(&m.CreatedAt).AsColumn().WithUpdateProtection()
columns.Field(&m.UpdatedAt).AsColumn().WithInsertProtection()
columns.Field(&m.Name).AsColumn()
columns.Field(&m.Age).AsColumn()
columns.Field(&m.DeletedAt).AsColumn().WithInsertProtection() // configure soft deletion field/column
}).
WithSoftDeletion(func(m *User, softDeletion *gerpo.SoftDeletionBuilder[User]) {
//Configure set value for soft deletion fields/columns
Expand Down

0 comments on commit 5d06586

Please sign in to comment.