LdDl / bungen

Model generator for bun package
MIT License
3 stars 2 forks source link

[FEATURE REQUEST] Common ORM queries #3

Open LdDl opened 1 year ago

LdDl commented 1 year ago

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

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

LdDl commented 1 year ago

Base SELECT queries a.k.a. select * from t are done