go-jet

Results 152 comments of go-jet

You don't have to scan into whole complex destination. For instance: ```golang type Response struct { Header map[string]string ThirdParty ThirdParty Data struct { model.Actor Films []model.Film } } ``` Only...

Hi @anuraaga. When dealing with data retrieval, insert or update, recommended way is to use model types. Model types will add type and pointer safety to the query. And literal...

Yeah, it is a valid point. For `created_at` there are other alternatives. It is possible to set `created_at` to `time.Now()` in model type, or define a column to be `DEFAULT...

Hi @philippta . All the internal types of interest are exported through dialect package([for instance](https://github.com/go-jet/jet/blob/master/sqlite/expressions.go)). There is no need to use internal package. In this case you should only import...

[wiki](https://github.com/go-jet/jet/wiki/FAQ#how-to-use-innot_in-with-dynamic-list-of-values)

Hi @jaupe. It is possible to add tags to model types using [generator customization](https://github.com/go-jet/jet/wiki/Generator#generator-customization). Check the [test sample](https://github.com/go-jet/jet/blob/f2e4b8551c48b97d0cd2d3deff47dc1b2aa2f04e/tests/postgres/generator_template_test.go#L274).

It's not possible for the generator to add new types, only to modify existing ones related to individual columns. Something to think about and maybe add such a feature it...

What would be the use case? To set a default schema name during server startup and then during the server lifespan only that schema will be used? If thats the...

Yes, `FromSchema` method was added to the latest release. In the feature, new auto generated global function might be added, to automate schema rename of all global table objects. Something...

Hi @ibadi-id. Check [raw expression](https://github.com/go-jet/jet/wiki/Expressions#raw-expression) and [faq](https://github.com/go-jet/jet/wiki/FAQ#how-to-call-custom-or-currently-unsupported-sql-function). ```golang stmt := SELECT( Raw("rowid").AS("row_id"), Account.AllColumns, ).FROM(Account) var dest struct { RowID int64 model.Account } err := stmt.Query(db, &dest) ```