I am a bit confused as to how to tell DBIx::Class (version 0.082843 on SQLite) not to change ANY table, column, relationship names. The whole lot.

I found the naming key in the parameters of https://metacpan.org/pod/DBIx::Class::Schema::Loader#make_schema_at (version 0.07051) to take values like:

naming => { monikers => 'preserve', relationships => 'preserve', column_accessors => 'preserve', }

This works (AFAICS) except when it creates relationships wtth CamelNames it breaks their hump: camel_names. Surely this is animal cruelty. I tried using all available options for relationships => v4, v5, v6, v7, v8, preserve (See https://metacpan.org/pod/DBIx::Class::Schema::Loader::Base#naming).

Additionally, on trying the different relationships => v4, v5, v6, v7, v8, current there are serious changes in the relationships code other than just the names. For example on 'v4' I get:

__PACKAGE__->belongs_to( "MyRefTableId", "My::Schema::Result::MyRefTable", { "Id" => "MyRefTableId", }, );

and when using 'current' I get:

__PACKAGE__->belongs_to( "MyRefTableId", "My::Schema::Result::MyRefTable", { "Id" => "MyRefTableId", }, { "is_deferrable" => "0", "on_delete" => "NO ACTION", "on_update" => "NO ACTION", }, );

Which, AFAICT, it not only changes the naming conventions but changes the logic!

My DB schema is dictated by JSON from a REST API which I have no control. They use CamelNames. I want to replicate EXACTLY that. I do not want:

So, simple question: how can DBIx::Class et.al. not chnage any names in my SQL create-tables. Not a single iota.

bw, bliako


In reply to DBIx::Class : stop changing table, column, relationship names by bliako

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.