No subject


Sun Nov 20 20:48:46 GMT 2022


```
On Sun Nov 11 23:54:27 2012, CMCKAY wrote:
> Can you revert the sanity checking so accessors can start with a digit
> again please.

Class::Accessor::Grouped with a builtin escape hatch uploaded to CPAN.
Sorry for the delay. Rationale can be found here[1].

The bug is still valid and critical - DBIC::SL must stop attempting to
create bogus accessors.

[1]
https://metacpan.org/module/RIBASUSHI/Class-Accessor-Grouped-0.10008/lib/Class/Accessor/Grouped.pm#Notes-on-accessor-names
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/dbix-class-schema-loader/issues/50
You are receiving this because you are subscribed to this thread.

Message ID: <dbsrgits/dbix-class-schema-loader/issues/50 at github.com>
----==_mimepart_637a936fb1cad_5124c6701760088
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

<p></p>
<p dir="auto">Migrated from <a href="https://rt.cpan.org/Ticket/Display.html?id=81112" rel="nofollow">rt.cpan.org#81112</a> (status was 'open')</p>
<p dir="auto">Requestors:</p>
<ul dir="auto">
<li><a href="mailto:CMCKAY at cpan.org">CMCKAY at cpan.org</a></li>
</ul>
<p dir="auto">From <a href="mailto:cmckay at cpan.org">cmckay at cpan.org</a> on 2012-11-12 04:54:27<br>
:</p>
<pre class="notranslate"><code class="notranslate">Hi,

Upgraded Class::Accessor::Grouped and some of my existing code stopped 
working. The code in question is a dbix::class schema generated by 
DBIx::Class::Schema::Loader and used one of my db column names 
(1900_call_description) as an accessor name. Can you revert the sanity 
checking so accessors can start with a digit again please.


Thanks,
-Chris Mckay
</code></pre>
<p dir="auto">From <a href="mailto:ribasushi at leporine.io">ribasushi at leporine.io</a> on 2012-11-12 09:22:15<br>
:</p>
<pre class="notranslate"><code class="notranslate">I switched the queue of this bug, as it is S::L's problem, not CAG's.
You are confusing the ability to have columns with any name, with the
ability to create an arbitrary accessor name. You may not do the later
in perl (at least not normally) - every accessor must* conform to
/\A[A-Z_a-z][0-9A-Z_a-z]*\z/.

This is not only limited to numbers - S::L has a general deficiency in
constructiong accessor names. It has been argued for several years that
S::L must sanitycheck all resulting accessor names and specify 'accessor
=&gt; undef' for anything that seems out of line. Sadly the former
maintainer was extremely uncooperative on this problem.

So two courses of action:
Long term  _default_column_accessor_name() needs a facelift to stop
asking the system to create accessors with illegal names (patches very
very very welcome).
Short term all you need to do is provide a custom column naming callback
via
https://metacpan.org/module/DBIx::Class::Schema::Loader::Base#col_accessor_map

In the meantime I will have to re-relase a CAG with the ability to
shutoff the check via an envvar. Creating broken accessor names however
will not be the default mode of operation.

Cheers

* The "must" here is a little ambiguous. One of course can always do
$obj-&gt;${\"666 random crap of a name"}, but one can never do 'sub
666_haha { ... }'. Since the job of CAG is to make generally accessible
accessors (haha), there is little argument in allowing weird naming.
Especially given the workaround availability as stated above.
</code></pre>
<p dir="auto">From <a href="mailto:ribasushi at leporine.io">ribasushi at leporine.io</a> on 2012-11-15 10:10:55<br>
:</p>
<pre class="notranslate"><code class="notranslate">On Sun Nov 11 23:54:27 2012, CMCKAY wrote:
&gt; Can you revert the sanity checking so accessors can start with a digit
&gt; again please.

Class::Accessor::Grouped with a builtin escape hatch uploaded to CPAN.
Sorry for the delay. Rationale can be found here[1].

The bug is still valid and critical - DBIC::SL must stop attempting to
create bogus accessors.

[1]
https://metacpan.org/module/RIBASUSHI/Class-Accessor-Grouped-0.10008/lib/Class/Accessor/Grouped.pm#Notes-on-accessor-names
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />Reply to this email directly, <a href="https://github.com/dbsrgits/dbix-class-schema-loader/issues/50">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AACJ4AWKYGREIC4JEBJXBYDWJKFO7ANCNFSM6AAAAAASGAWDDE">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AACJ4AQ3RB7MTQCQH3SKJXTWJKFO7A5CNFSM6AAAAAASGAWDDGWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHFNWFSRY.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span>&lt;dbsrgits/dbix-class-schema-loader/issues/50</span><span>@</span><span>github</span><span>.</span><span>com&gt;</span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/dbsrgits/dbix-class-schema-loader/issues/50",
"url": "https://github.com/dbsrgits/dbix-class-schema-loader/issues/50",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>
----==_mimepart_637a936fb1cad_5124c6701760088--



More information about the DBIx-Class-Devel mailing list