aboutsummaryrefslogtreecommitdiff
path: root/lib/sql/row.go
AgeCommit message (Collapse)Author
2024-03-05lib/sql: remove deprecated Row typeShulhan
The Row type has been replaced with Meta type with more flexibility and features for generating type-safe SQL DML.
2024-03-05all: comply with linter recommendations #2Shulhan
HTTP request now implicitly create request with context. Any false positive related to not closing HTTP response body has been annotated with "nolint:bodyclose". In the example code, use consistent "// Output:" comment format, by prefixing with single space. Any comment on code now also prefixing with single space. An error returned without variables now use [errors.New] instead of [fmt.Errorf]. Any error returned using [fmt.Errorf] now wrapped using "%w" instead of "%s". Also, replace error checking using [errors.Is] or [errors.As], instead of using equal/not-equal operator. Any statement like "x = x OP y" now replaced with "x OP= y". Also, swap statement is simplified using "x, y = y, x". Any switch statement with single case now replaced with if-condition. Any call to defer on function or program that call [os.Exit], now replaced by calling the deferred function directly. Any if-else condition now replaced with switch statement, if possible.
2024-01-25lib/sql: add new type MetaShulhan
Meta contains the DML meta data, including driver name, list of column names, list of column holders, and list of values. The Meta type replace the Row type.
2022-05-09all: reformat all codes using gofmt 1.19 (the Go tip)Shulhan
2021-02-07sql: change the parameter ExtractSQLFields to driver nameShulhan
Previously, we use the string as parameter to set the returned place holders. This commit changes the parameter to the driver name so if the value is "postgres" the place holders will be returned as counter, for example "$1", "$2", and so on.
2021-02-05sql: sort returned names on ExtractSQLFields sorted in ascending orderShulhan
This is to make sure that any test that use the package always predictable. While at it, add paramter to change placeholder on ExtractSQLFields.
2020-06-10all: update email addressShulhan
2020-02-13sql: a new package as an extension to "database/sql"Shulhan