Skip to content

Releases: tkcrm/pgxgen

v0.2.7

03 Oct 09:15
fd816fd
Compare
Choose a tag to compare

NEW

  • bump sqlc version to v1.22
  • update deps

v0.2.6

13 Sep 11:53
347b3af
Compare
Choose a tag to compare

Updates

  • set string type for version field in sqlc config
  • update sqlc deps

v0.2.5

06 Sep 19:49
09912a9
Compare
Choose a tag to compare

NEW

  • bump go module to 1.21
  • bump sqlc version to 1.21
  • update all deps

v0.2.4

07 Aug 18:35
dfb0a62
Compare
Choose a tag to compare

New

  • bump sqlc version to 1.20

Fix

  • fix commands version, help, check-version when sqlc and pgxgen configs not provided

v0.2.3

13 Jul 20:05
5ff581e
Compare
Choose a tag to compare

NEW

  • bump sqlc version to 1.19.1

v0.2.2

08 Jul 11:16
5b61cd5
Compare
Choose a tag to compare

v0.2.2

NEW

  • bump sqlc version to 1.19
  • update deps

v0.2.1

04 Jun 22:24
ef692bf
Compare
Choose a tag to compare

v0.2.1

  • fix version

v0.2.0

04 Jun 22:13
2ce740f
Compare
Choose a tag to compare

v0.2.0

  • added support for pgx v5
  • bump sqlc version to 1.18
  • bump min go version to 1.20
  • update all dependencies

For an example of how to use pgx v5, check out this repository: pgxgen-example

v0.1.0

08 Apr 13:28
4972b61
Compare
Choose a tag to compare

This release contains critical changes for the configuration file, improved logic in go models, as well as fixing some bugs

Changes

Support for multi schema in one repository

Due to the fact that there is support for multiple migration files for one repository, it was decided to change the configuration file. An example is attached below

Config before:

version: 1
disable_auto_replace_sqlc_nullable_types: false
sqlc_move_models:
  output_dir: "internal/models"
  output_filename: "models.go"
  package_name: models
  package_path: github.com/company/project/internal/models
crud_params:
  auto_remove_generated_files: true
  exclude_table_name_from_methods: false
  tables:
    user:
      output_dir: sql/queries/users
      primary_column: id
      methods:
        create:
          skip_columns:
            - id
            - updated_at
          returning: "*"
go_constants:
  tables:
    users:
      output_dir: internal/store/users/repo_users

Config now:

version: 1
sqlc:
  - schema_dir: sql/migrations
    models:
      replace_sqlc_nullable_types: true
      move:
        output_dir: internal/models
        output_file_name: models_gen.go
        package_name: models
        package_path: github.com/company/project/internal/models
    crud:
      auto_remove_generated_files: true
      exclude_table_name_from_methods: false
      tables:
        user:
          output_dir: sql/queries/users
          primary_column: id
          methods:
            create:
              skip_columns:
                - id
                - updated_at
              returning: "*"
    constants:
      tables:
        users:
          output_dir: internal/store/users/repo_users

sqlc move models changes

  • disable_auto_replace_sqlc_nullable_types moved to sqlc[0].models.replace_sqlc_nullable_types
  • sqlc_move_models moved to sqlc[0].models.move
  • sqlc_move_models.output_filename renamed to sqlc[0].models.move.output_file_name and not it is required

crud changes

  • crud_params moved to sqlc[0].crud
  • sqlc[0].schema_dir is required param

go constants changes

  • go_constants moved to sqlc[0].constants

go models changes

  • remove gen_models.delete_sqlc_data
  • gen_models.models_output_dir moved to gen_models.output_dir
  • gen_models.models_output_filename moved to gen_models.output_file_name
  • gen_models.models_package_name moded to gen_models.package_name
  • gen_models.models_imports moved to gen_models.models_imports
  • added new param gen_models.input_file_path
  • added new param gen_models.input_dir
  • added new param gen_models.delete_original_files
  • added new param gen_models.rename: rename structs to new name
  • added new param gen_models.exclude_structs: exclude structs from result list
  • added new param gen_models.include_structs: only the listed structures will be used

json_tags

removed support for json_tags, because we have updated go models functionality which can do much more with json tags

load configs from another paths

Now you can use any different names for config files.

  • pgxgen example: pgxgen --pgxgen-config pgxgen-new.yaml
  • sqlc example: pgxgen --sqlc-config sqlc-new.yaml

Check for new version

Added new commanв for checking latest version

pgxgen check-version

Some Changes

  • use custom logger instead of fmt package
  • more convenient processing of cli commands
  • logging with time durations
  • new utilities, improvements to existing functionality and performance optimization
  • starting from this release, we will gradually cover all the code with tests. some tests already added

v0.0.26

26 Feb 13:06
0458f59
Compare
Choose a tag to compare

v0.0.26

NEW

  • bump sqlc version to 1.17.2
  • added tool to copy sqlc files to pkg/sqlc dir