You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your hard work, this library help me a lot, and I have a question about the table name:
As state in the ReadMe doc, the following struct will map to person table,
//reform:people
type Person struct {
ID int32 `reform:"id,pk"`
Name string `reform:"name"`
Email *string `reform:"email"`
CreatedAt time.Time `reform:"created_at"`
UpdatedAt *time.Time `reform:"updated_at"`
}
After diving into code, I didn't find any way to reuse this Person struct to other table with the same structure, please advice if I miss any parts:)
So I'd like to propose a set of new Functions like SaveOnTable(record, table_name), UpdateOnTable(record, table_name) etc, which will execute SQL on the appointed table and make it possible to reuse this struct on many tables or sharding tables, like:
person_00
person_01
...
person_99
Please help review this feature request.
The text was updated successfully, but these errors were encountered:
// WithTag returns a copy of Querier with set view name. Returned Querier is tied to the same DB or TX.func (q*Querier) WithView(viewName) *Querier {
// …
}
// …DB.WithView("person_42").Save(record)
Dear developers,
Thanks for your hard work, this library help me a lot, and I have a question about the table name:
As state in the ReadMe doc, the following struct will map to person table,
After diving into code, I didn't find any way to reuse this Person struct to other table with the same structure, please advice if I miss any parts:)
So I'd like to propose a set of new Functions like SaveOnTable(record, table_name), UpdateOnTable(record, table_name) etc, which will execute SQL on the appointed table and make it possible to reuse this struct on many tables or sharding tables, like:
Please help review this feature request.
The text was updated successfully, but these errors were encountered: