This is a temporary fork that I have been working on with the intention of backporting the changes to the upstream pggen. It is not fully functional.
Because of the changes in how types are managed in v4 compared to v5, type registration needs to be configured in the AfterConnect function on the pgx config.
dbconfig, err := pgxpool.ParseConfig(databaseURL)
if err != nil {
// handle error
}
dbconfig.AfterConnect = func(ctx context.Context, pgconn *pgconn.PgConn) error {
err := your_gen_pkg.Register(ctx, pgconn)
if err != nil {
return fmt.Errorf("failed to register types: %w", err)
}
return nil
}The following examples compile, and are implemented.
- example/author
- example/domain
- example/go_pointer_types
- example/inline_param_count
- example/pgcrypto
- example/slices
- example/syntax
- example/custom_types
- example/enums
- example/device
- example/function
- example/separate_out_dir/out
- example/erp/order
- example/ltree
- example/void
- example/composite
- example/citext
- example/nested
- example/complex_params