{"repo":"georgysavva/scany","free":true,"listed":false,"github":"https://github.com/georgysavva/scany","clone":"git clone https://github.com/georgysavva/scany.git","description":"Library for scanning data from a database into Go structs and more","language":"Go","stars":1521,"topics":["go","golang","database","sql","postgresql","pgx","mysql"],"license":"MIT","category":"databases-storage","readme_excerpt":"scany Overview Go favors simplicity, and it's pretty common to work with a database via driver directly without any ORM. It provides great control and efficiency in your queries, but here is a problem: you need to manually iterate over database rows and scan data from all columns into a corresponding destination. It can be error-prone verbose and just tedious. scany aims to solve this problem. It allows developers to scan complex data from a database into Go structs and other composite types with just one function call and don't bother with rows iteration. scany isn't limited to any specific database. It integrates with database/sql , so any database with database/sql driver is supported. It also works with pgx library native interface. Apart from the out-of-the-box support, scany can be easily extended to work with almost any database library. Note that scany isn't an ORM. First of all, it works only in one direction: it scans data into Go objects from the database, but it can't build database queries based on those objects. Secondly, it doesn't know anything about relations between objects e.g: one to many, many to many. Features - Custom database column name via struct tag - Reusing structs via nesting or embedding - NULLs and custom types support - Omitted struct fields - Apart from structs, support for maps and Go primitive types as the destination - Override default settings Install How to use with database/sql Use sqlscan package to work with database/sql standard libr","default_branch":null,"files":null,"tree":[],"storefront":"/r/georgysavva","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/georgysavva/scany/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."}