Skip to content

Generating schema Fails #408

Closed
Closed
@safaci2000

Description

Describe the bug
The code generator should fail if datamodel contains reserved fields.

There is a collision with the way the code is constructed, because postgres.Table exposes TalbeName() and the table contains a field named TableName the code does not compile.

Environment (please complete the following information):

  • OS: mac os X
  • Database: postgres
  • Database driver: pgx
  • Jet version: master

Code snippet

create schema audit;
drop table if exists audit.audit_actions;
create table audit.audit_actions
(
    schema_name text not null,
    table_name text not null,
    trx_id text default txid_current(),
    user_name text,
    app_user text,
    action TEXT NOT NULL,
    old_data jsonb,
    new_data jsonb,
    query text,
    creation_date timestamp with time zone DEFAULT now() NOT NULL
) with (fillfactor=100);

Expected behavior
Generated code to compile successfully or fail hard on the generation and provide context on the reason for the failure

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions