{"repo":"blockloop/scan","free":true,"listed":false,"github":"https://github.com/blockloop/scan","clone":"git clone https://github.com/blockloop/scan.git","description":"Tiny lib to scan SQL rows directly to structs, slices, and primitive types","language":"Go","stars":614,"topics":["golang","sql","database","scanning","squirrel"],"license":"MIT","category":"databases-storage","readme_excerpt":"Scan [!NOTE] For all intents and purposes, this project is considered 'complete.' I do not plan on making any changes in the near future and have not written any code here since approximately 2021. To the best of my knowledge, everything functions as intended. If you are seeking a more comprehensive solution, please refer to https://github.com/stytchauth/sqx. That being said, this project operates effectively in its current state and requires no new code. Feel free to fork it and continue development if desired. Scan standard lib database rows directly to structs or slices. For the most comprehensive and up-to-date docs see the godoc Examples Multiple Rows Multiple rows of primitive type Single row Scalar value Nested Struct Fields (as of v2.0.0) Custom Column Mapping By default, column names are mapped to and from database column names using basic title case conversion. You can override this behavior by setting ColumnsMapper and ScannerMapper to custom functions. Strict Scanning Both Rows and Row have strict alternatives to allow scanning to structs strictly based on their db tag. To avoid unwanted behavior you can use RowsStrict or RowStrict to scan without using field names. Any fields not tagged with the db tag will be ignored even if columns are found that match the field names. Columns Columns scans a struct and returns a string slice of the assumed column names based on the db tag or the struct field name respectively. To avoid assumptions, use ColumnsStrict which will","default_branch":null,"files":null,"tree":[],"storefront":"/r/blockloop","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/blockloop/scan/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}