Skip to content

Disable adding JSON sample to go files #194

@jpmeijers

Description

@jpmeijers

Currently every generated file has comments at the top, which includes a description of the database table and fields, followed by a json sample of the data. This json sample changes every time gen is run. This means git detects file changes in all the generated files.

It would be great if this json sample does not change when gen is run again. Or maybe we could just exclude this json sample from the comments.

Example:

/*
DB Table Details
-------------------------------------


Table: billing_backend_usertenant
[ 0] id                                             INT8                 null: false  primary: true   isArray: false  auto: true   col: INT8            len: -1      default: []
[ 1] tenant_id                                      INT8                 null: false  primary: false  isArray: false  auto: false  col: INT8            len: -1      default: []
[ 2] user_id                                        INT4                 null: false  primary: false  isArray: false  auto: false  col: INT4            len: -1      default: []


JSON Sample
-------------------------------------
{    "id": 52,    "tenant_id": 19,    "user_id": 76}



*/

changes to the following when gen was run again

/*
DB Table Details
-------------------------------------


Table: billing_backend_usertenant
[ 0] id                                             INT8                 null: false  primary: true   isArray: false  auto: true   col: INT8            len: -1      default: []
[ 1] tenant_id                                      INT8                 null: false  primary: false  isArray: false  auto: false  col: INT8            len: -1      default: []
[ 2] user_id                                        INT4                 null: false  primary: false  isArray: false  auto: false  col: INT4            len: -1      default: []


JSON Sample
-------------------------------------
{    "id": 77,    "tenant_id": 87,    "user_id": 69}



*/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions