func (p PGXRows) Close() error {
	p.Rows.Close()
	return nil
}
Close implements the Rows interface
package ksql
import (
	"context"
	"fmt"
	"github.com/jackc/pgconn"
	"github.com/jackc/pgx/v4"
	"github.com/jackc/pgx/v4/pgxpool"
)
type PGXAdapter struct {
	db *pgxpool.Pool
}
func NewPGXAdapter(db *pgxpool.Pool) PGXAdapter {
	return PGXAdapter{
		db: db,
	}
}
var _ DBAdapter = PGXAdapter{}
func (p PGXAdapter) ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error) {
	result, err := p.db.Exec(ctx, query, args...)
	return PGXResult{result}, err
}
func (p PGXAdapter) QueryContext(ctx context.Context, query string, args ...interface{}) (Rows, error) {
	rows, err := p.db.Query(ctx, query, args...)
	return PGXRows{rows}, err
}
func (p PGXAdapter) BeginTx(ctx context.Context) (Tx, error) {
	tx, err := p.db.Begin(ctx)
	return PGXTx{tx}, err
}
type PGXResult struct {
	tag pgconn.CommandTag
}
func (p PGXResult) RowsAffected() (int64, error) {
	return p.tag.RowsAffected(), nil
}
func (p PGXResult) LastInsertId() (int64, error) {
	return 0, fmt.Errorf(
		"LastInsertId is not implemented in the pgx adapter, use the `RETURNING` statement instead",
	)
}
type PGXTx struct {
	tx pgx.Tx
}
func (p PGXTx) ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error) {
	result, err := p.tx.Exec(ctx, query, args...)
	return PGXResult{result}, err
}
func (p PGXTx) QueryContext(ctx context.Context, query string, args ...interface{}) (Rows, error) {
	rows, err := p.tx.Query(ctx, query, args...)
	return PGXRows{rows}, err
}
func (p PGXTx) Rollback(ctx context.Context) error {
	return p.tx.Rollback(ctx)
}
func (p PGXTx) Commit(ctx context.Context) error {
	return p.tx.Commit(ctx)
}
var _ Tx = PGXTx{}
type PGXRows struct {
	pgx.Rows
}
var _ Rows = PGXRows{}
func (p PGXRows) Columns() ([]string, error) {
	var names []string
	for _, desc := range p.Rows.FieldDescriptions() {
		names = append(names, string(desc.Name))
	}
	return names, nil
}