### Get function signature Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan Get is a package-level helper function that uses the DefaultAPI object. See API.Get for details. ```go func Get(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error ``` -------------------------------- ### func Get(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan Get is a package-level helper function that uses the DefaultAPI object. It executes a query and scans the first row into dst. ```APIDOC ## func Get(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error ### Description Get is a package-level helper function that uses the DefaultAPI object. It executes a query and scans the first row into dst. ### Function Signature func Get(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error ### Parameters - **ctx** (context.Context) - Required - The context for the operation. - **db** (Querier) - Required - The database connection or pool that implements the Querier interface. - **dst** (interface{}) - Required - The destination to scan the result into. - **query** (string) - Required - The SQL query to execute. - **args** (...interface{}) - Optional - Query parameters. ### Return Value - **error** - Returns an error if the operation fails. ``` -------------------------------- ### func (api *API) Get(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan Get is a high-level function that queries rows from Querier and calls the ScanOne function. See ScanOne for details. ```APIDOC ## func (api *API) Get ### Description Get is a high-level function that queries rows from Querier and calls the ScanOne function. See ScanOne for details. ### Signature func (api *API) Get(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error ### Parameters - **ctx** (context.Context) - Required - The context for the query. - **db** (Querier) - Required - The database querier. - **dst** (interface{}) - Required - Destination to scan the row into. - **query** (string) - Required - The SQL query string. - **args** (...interface{}) - Optional - Query arguments. ### Returns - **error** - An error if the query or scanning fails. ``` -------------------------------- ### func Select(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan Select is a package-level helper function that uses the DefaultAPI object. It executes a query and scans all rows into dst. ```APIDOC ## func Select(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error ### Description Select is a package-level helper function that uses the DefaultAPI object. It executes a query and scans all rows into dst. ### Function Signature func Select(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error ### Parameters - **ctx** (context.Context) - Required - The context for the operation. - **db** (Querier) - Required - The database connection or pool that implements the Querier interface. - **dst** (interface{}) - Required - The destination to scan the result into. - **query** (string) - Required - The SQL query to execute. - **args** (...interface{}) - Optional - Query parameters. ### Return Value - **error** - Returns an error if the operation fails. ``` -------------------------------- ### ScanAll function signature Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan ScanAll is a package-level helper function that uses the DefaultAPI object. See API.ScanAll for details. ```go func ScanAll(dst interface{}, rows pgx.Rows) error ``` -------------------------------- ### func Select(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan Package-level helper function that uses the DefaultAPI object. See API.Select for details. ```APIDOC ## func Select ### Description Select is a package-level helper function that uses the DefaultAPI object. See API.Select for details. ### Signature func Select(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error ### Parameters - **ctx** (context.Context) - Required - The context for the query. - **db** (Querier) - Required - The database querier. - **dst** (interface{}) - Required - Destination to scan the results into. - **query** (string) - Required - The SQL query string. - **args** (...interface{}) - Optional - Query arguments. ### Returns - **error** - An error if the query or scanning fails. ``` -------------------------------- ### func NewAPI(dbscanAPI *dbscan.API) (*API, error) Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan NewAPI creates a new API instance from a dbscan.API instance. ```APIDOC ## func NewAPI ### Description NewAPI creates a new API instance from a dbscan.API instance. ### Signature func NewAPI(dbscanAPI *dbscan.API) (*API, error) ### Parameters - **dbscanAPI** (*dbscan.API) - Required - The dbscan.API instance to wrap. ### Returns - **(*API, error)** - A new API instance and an error if creation fails. ``` -------------------------------- ### func NewDBScanAPI(opts ...dbscan.APIOption) (*dbscan.API, error) Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan NewDBScanAPI creates a new dbscan API object with default configuration settings for pgxscan. ```APIDOC ## func NewDBScanAPI(opts ...dbscan.APIOption) (*dbscan.API, error) ### Description NewDBScanAPI creates a new dbscan API object with default configuration settings for pgxscan. ### Function Signature func NewDBScanAPI(opts ...dbscan.APIOption) (*dbscan.API, error) ### Parameters - **opts** (...dbscan.APIOption) - Optional - Configuration options for the dbscan API. ### Return Value - **(*dbscan.API, error)** - Returns a new dbscan API object and an error if creation fails. ``` -------------------------------- ### DefaultAPI variable declaration Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan DefaultAPI is the default instance of API with all configuration settings set to default. ```go var DefaultAPI = mustNewAPI(mustNewDBScanAPI()) ``` -------------------------------- ### func (api *API) Select(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan Select is a high-level function that queries rows from Querier and calls the ScanAll function. See ScanAll for details. ```APIDOC ## func (api *API) Select ### Description Select is a high-level function that queries rows from Querier and calls the ScanAll function. See ScanAll for details. ### Signature func (api *API) Select(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error ### Parameters - **ctx** (context.Context) - Required - The context for the query. - **db** (Querier) - Required - The database querier. - **dst** (interface{}) - Required - Destination to scan the results into. - **query** (string) - Required - The SQL query string. - **args** (...interface{}) - Optional - Query arguments. ### Returns - **error** - An error if the query or scanning fails. ``` -------------------------------- ### func ScanAll(dst interface{}, rows pgx.Rows) error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan ScanAll is a package-level helper function that uses the DefaultAPI object. It scans all rows into dst. ```APIDOC ## func ScanAll(dst interface{}, rows pgx.Rows) error ### Description ScanAll is a package-level helper function that uses the DefaultAPI object. It scans all rows into dst. ### Function Signature func ScanAll(dst interface{}, rows pgx.Rows) error ### Parameters - **dst** (interface{}) - Required - The destination to scan the rows into. - **rows** (pgx.Rows) - Required - The rows to scan. ### Return Value - **error** - Returns an error if the operation fails. ``` -------------------------------- ### func (ra RowsAdapter) NextResultSet() bool Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan NextResultSet is currently always returning false. ```APIDOC ## func (ra RowsAdapter) NextResultSet ### Description NextResultSet is currently always returning false. ### Signature func (ra RowsAdapter) NextResultSet() bool ### Returns - **bool** - Always returns false. ``` -------------------------------- ### func ScanOne(dst interface{}, rows pgx.Rows) error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan Package-level helper function that uses the DefaultAPI object. See API.ScanOne for details. ```APIDOC ## func ScanOne ### Description ScanOne is a package-level helper function that uses the DefaultAPI object. See API.ScanOne for details. ### Signature func ScanOne(dst interface{}, rows pgx.Rows) error ### Parameters - **dst** (interface{}) - Required - Destination to scan the row into. - **rows** (pgx.Rows) - Required - The rows to scan. ### Returns - **error** - An error if scanning fails. ``` -------------------------------- ### func (api *API) ScanAll(dst interface{}, rows pgx.Rows) error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan ScanAll is a wrapper around the dbscan.ScanAll function. See dbscan.ScanAll for details. ```APIDOC ## func (api *API) ScanAll ### Description ScanAll is a wrapper around the dbscan.ScanAll function. See dbscan.ScanAll for details. ### Signature func (api *API) ScanAll(dst interface{}, rows pgx.Rows) error ### Parameters - **dst** (interface{}) - Required - Destination to scan the rows into. - **rows** (pgx.Rows) - Required - The rows to scan. ### Returns - **error** - An error if scanning fails. ``` -------------------------------- ### ScanOne function signature Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan ScanOne is a package-level helper function that uses the DefaultAPI object. See API.ScanOne for details. ```go func ScanOne(dst interface{}, rows pgx.Rows) error ``` -------------------------------- ### func ScanOne(dst interface{}, rows pgx.Rows) error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan ScanOne is a package-level helper function that uses the DefaultAPI object. It scans a single row into dst. ```APIDOC ## func ScanOne(dst interface{}, rows pgx.Rows) error ### Description ScanOne is a package-level helper function that uses the DefaultAPI object. It scans a single row into dst. ### Function Signature func ScanOne(dst interface{}, rows pgx.Rows) error ### Parameters - **dst** (interface{}) - Required - The destination to scan the row into. - **rows** (pgx.Rows) - Required - The rows to scan. ### Return Value - **error** - Returns an error if the operation fails. ``` -------------------------------- ### func NewRowsAdapter(rows pgx.Rows) *RowsAdapter Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan NewRowsAdapter returns a new RowsAdapter instance. ```APIDOC ## func NewRowsAdapter ### Description NewRowsAdapter returns a new RowsAdapter instance. ### Signature func NewRowsAdapter(rows pgx.Rows) *RowsAdapter ### Parameters - **rows** (pgx.Rows) - Required - The rows to adapt. ### Returns - **(*RowsAdapter)** - A new RowsAdapter instance. ``` -------------------------------- ### func ScanRow(dst interface{}, rows pgx.Rows) error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan Package-level helper function that uses the DefaultAPI object. See API.ScanRow for details. ```APIDOC ## func ScanRow ### Description ScanRow is a package-level helper function that uses the DefaultAPI object. See API.ScanRow for details. ### Signature func ScanRow(dst interface{}, rows pgx.Rows) error ### Parameters - **dst** (interface{}) - Required - Destination to scan the row into. - **rows** (pgx.Rows) - Required - The rows to scan. ### Returns - **error** - An error if scanning fails. ``` -------------------------------- ### func NotFound(err error) bool Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan NotFound is a helper function to check if an error is pgx.ErrNoRows. ```APIDOC ## func NotFound(err error) bool ### Description NotFound is a helper function to check if an error is pgx.ErrNoRows. ### Function Signature func NotFound(err error) bool ### Parameters - **err** (error) - Required - The error to check. ### Return Value - **bool** - Returns true if the error is pgx.ErrNoRows, false otherwise. ``` -------------------------------- ### type API Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan API is a type that provides methods for scanning rows and executing queries. It can be created with NewAPI. ```APIDOC ## type API ### Description API is a type that provides methods for scanning rows and executing queries. It can be created with NewAPI. ### Methods - **func NewAPI(dbscanAPI *dbscan.API) (*API, error)** - Creates a new API object. - **func (api *API) Get(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error** - Executes a query and scans the first row into dst. - **func (api *API) NewRowScanner(rows pgx.Rows) *RowScanner** - Creates a new RowScanner for the given rows. - **func (api *API) ScanAll(dst interface{}, rows pgx.Rows) error** - Scans all rows into dst. - **func (api *API) ScanOne(dst interface{}, rows pgx.Rows) error** - Scans a single row into dst. - **func (api *API) ScanRow(dst interface{}, rows pgx.Rows) error** - Scans the current row into dst. - **func (api *API) Select(ctx context.Context, db Querier, dst interface{}, query string, args ...interface{}) error** - Executes a query and scans all rows into dst. ``` -------------------------------- ### func (api *API) ScanOne(dst interface{}, rows pgx.Rows) error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan ScanOne is a wrapper around the dbscan.ScanOne function. See dbscan.ScanOne for details. If no rows are found it returns a pgx.ErrNoRows error. ```APIDOC ## func (api *API) ScanOne ### Description ScanOne is a wrapper around the dbscan.ScanOne function. See dbscan.ScanOne for details. If no rows are found it returns a pgx.ErrNoRows error. ### Signature func (api *API) ScanOne(dst interface{}, rows pgx.Rows) error ### Parameters - **dst** (interface{}) - Required - Destination to scan the row into. - **rows** (pgx.Rows) - Required - The rows to scan. ### Returns - **error** - An error if scanning fails, or pgx.ErrNoRows if no rows are found. ``` -------------------------------- ### NewDBScanAPI function signature Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan NewDBScanAPI creates a new dbscan API object with default configuration settings for pgxscan. ```go func NewDBScanAPI(opts ...dbscan.APIOption) (*dbscan.API, error) ``` -------------------------------- ### Define a struct with pgtype.Text by value for pgxscan compatibility Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan When using pgx custom types like pgtype.Text, specify them by value, not by pointer. Struct fields are passed to pgx.Rows.Scan() by pointer, so a *pgtype.Text field becomes **pgtype.Text, which pgx cannot handle. ```go type User struct { ID string Name *pgtype.Text // pgxscan won't be able to scan data into a field defined that way. Bio pgtype.Text // This is a valid use of pgx custom types, pgxscan will handle it easily. } ``` -------------------------------- ### func ScanRow(dst interface{}, rows pgx.Rows) error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan ScanRow is a package-level helper function that uses the DefaultAPI object. It scans the current row into dst. ```APIDOC ## func ScanRow(dst interface{}, rows pgx.Rows) error ### Description ScanRow is a package-level helper function that uses the DefaultAPI object. It scans the current row into dst. ### Function Signature func ScanRow(dst interface{}, rows pgx.Rows) error ### Parameters - **dst** (interface{}) - Required - The destination to scan the row into. - **rows** (pgx.Rows) - Required - The rows to scan. ### Return Value - **error** - Returns an error if the operation fails. ``` -------------------------------- ### type Querier Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan Querier is an interface that represents a database connection or pool that can execute queries. ```APIDOC ## type Querier ### Description Querier is an interface that represents a database connection or pool that can execute queries. It is implemented by *pgxpool.Pool, *pgx.Conn, and pgx.Tx. ``` -------------------------------- ### NotFound function signature Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan NotFound is a helper function to check if an error is `pgx.ErrNoRows`. ```go func NotFound(err error) bool ``` -------------------------------- ### func (api *API) NewRowScanner(rows pgx.Rows) *RowScanner Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan NewRowScanner returns a new RowScanner instance. ```APIDOC ## func (api *API) NewRowScanner ### Description NewRowScanner returns a new RowScanner instance. ### Signature func (api *API) NewRowScanner(rows pgx.Rows) *RowScanner ### Parameters - **rows** (pgx.Rows) - Required - The rows to scan. ### Returns - **(*RowScanner)** - A new RowScanner instance. ``` -------------------------------- ### func (api *API) ScanRow(dst interface{}, rows pgx.Rows) error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan ScanRow is a wrapper around the dbscan.ScanRow function. See dbscan.ScanRow for details. ```APIDOC ## func (api *API) ScanRow ### Description ScanRow is a wrapper around the dbscan.ScanRow function. See dbscan.ScanRow for details. ### Signature func (api *API) ScanRow(dst interface{}, rows pgx.Rows) error ### Parameters - **dst** (interface{}) - Required - Destination to scan the row into. - **rows** (pgx.Rows) - Required - The rows to scan. ### Returns - **error** - An error if scanning fails. ``` -------------------------------- ### func NewRowScanner(rows pgx.Rows) *RowScanner Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan NewRowScanner is a package-level helper function that uses the DefaultAPI object. See API.NewRowScanner for details. ```APIDOC ## func NewRowScanner ### Description NewRowScanner is a package-level helper function that uses the DefaultAPI object. See API.NewRowScanner for details. ### Signature func NewRowScanner(rows pgx.Rows) *RowScanner ### Parameters - **rows** (pgx.Rows) - Required - The rows to scan. ### Returns - **(*RowScanner)** - A new RowScanner instance. ``` -------------------------------- ### func (ra RowsAdapter) Columns() ([]string, error) Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan Columns implements the dbscan.Rows.Columns method. ```APIDOC ## func (ra RowsAdapter) Columns ### Description Columns implements the dbscan.Rows.Columns method. ### Signature func (ra RowsAdapter) Columns() ([]string, error) ### Returns - **([]string, error)** - The column names and an error if retrieval fails. ``` -------------------------------- ### func (ra RowsAdapter) Close() error Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan Close implements the dbscan.Rows.Close method. ```APIDOC ## func (ra RowsAdapter) Close ### Description Close implements the dbscan.Rows.Close method. ### Signature func (ra RowsAdapter) Close() error ### Returns - **error** - An error if closing fails. ``` -------------------------------- ### type RowsAdapter Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan RowsAdapter is a type that adapts pgx.Rows to the dbscan interface. It provides methods for iterating over rows. ```APIDOC ## type RowsAdapter ### Description RowsAdapter is a type that adapts pgx.Rows to the dbscan interface. It provides methods for iterating over rows. ### Constructor - **func NewRowsAdapter(rows pgx.Rows) *RowsAdapter** - Creates a new RowsAdapter for the given rows. ### Methods - **func (ra RowsAdapter) Close() error** - Closes the adapter. - **func (ra RowsAdapter) Columns() ([]string, error)** - Returns the column names. - **func (ra RowsAdapter) NextResultSet() bool** - Advances to the next result set. ``` -------------------------------- ### type RowScanner Source: https://pkg.go.dev/github.com/georgysavva/scany/v2/pgxscan RowScanner is a type that provides methods for scanning rows. It can be created with NewRowScanner. ```APIDOC ## type RowScanner ### Description RowScanner is a type that provides methods for scanning rows. It can be created with NewRowScanner. ### Constructor - **func NewRowScanner(rows pgx.Rows) *RowScanner** - Creates a new RowScanner for the given rows. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.