{"repo":"stephenafamo/scan","free":true,"listed":false,"github":"https://github.com/stephenafamo/scan","clone":"git clone https://github.com/stephenafamo/scan.git","description":"Scan provides the ability to to scan sql rows directly to any defined structure.","language":"Go","stars":105,"topics":["database","go","golang","scan","sql"],"license":"MIT","category":"databases-storage","readme_excerpt":"Scan Scan provides the ability to use database/sql/rows to scan datasets directly to any defined structure. Reference - Standard library scan package. For use with database/sql . Link - PGX library scan package. For use with github.com/jackc/pgx/v5 . Link - Base scan package. For use with any implementation of scan.Queryer . Link Using with database/sql And many more!! Using with pgx Using with other DB packages Instead of github.com/stephenafamo/scan/stdscan , use the base package github.com/stephenafam/scan which only needs an executor that implements the right interface. Both stdscan and pgxscan are based on this. How it works Scanning Functions One() Use One() to scan and return a single row. All() Use All() to scan and return all rows. Each() Use Each() to iterate over the rows of a query using range. It works with the range-over-func syntax. Cursor() Use Cursor() to scan each row on demand. This is useful when retrieving large results. Mappers Each of these functions takes a Mapper to indicate how each row should be scanned. The Mapper has the signature: A mapper returns 2 functions - before : This is called before scanning the row. The mapper should schedule scans using one of the the ScheduleScan methods of the Row . The return value of the before function is passed to the after function after scanning values from the database. - after : This is called after the scan operation. The mapper should then covert the link value back to the desired concrete type. There are s","default_branch":null,"files":null,"tree":[],"storefront":"/r/stephenafamo","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/stephenafamo/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."}