Skip to content

[FEATURE REQUEST] Common ORM queries #3

Description

@LdDl

Is your feature request related to a problem? Please describe.
Consider to make automatic code generation for such ORM queries as:

  • Select all
  • Select by PK
  • Delete by PK
  • Update by PK

Describe the solution you'd like and provide pseudocode examples if you can
Do it in same manner as main functionality is done (use of text/template).
E.g. Select:

const tmpSelect = `
func (dbConn *{{ .DataBase }}) Select{{ .StructName }}() ([]*{{ .StructName }}, error) {
	ctx := context.Background()
	model := []*{{ .StructName }}{}
	err := dbConn.NewSelect().
		Model(&model).
		Scan(ctx)
	return model, err
}`

Additional context
Prepare new branch(-es) and do some testing stuff in it

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions