<p></p>
<p dir="auto"><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/ribasushi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ribasushi">@ribasushi</a><br>
If the metadata has some significant role in DBIC, I'll try to tweak DBD::SQLite not to break compat. Otherwise, +1 for this PR, because...</p>
<ol dir="auto">
<li>the value is directly set by <code>sqlite3_table_column_metadata</code> C API. DBD::SQLite (dbdimp.c) only newSVpv() it. <a href="https://github.com/DBD-SQLite/DBD-SQLite/blob/8bf916dbd7685dd9de7746015d2048d52a5ca7f8/dbdimp.c#L1955-L1970">https://github.com/DBD-SQLite/DBD-SQLite/blob/8bf916dbd7685dd9de7746015d2048d52a5ca7f8/dbdimp.c#L1955-L1970</a></li>
<li>there seems to have long been a chance to return an upper case value. See the following excerpt from sqlite3.c in SQLite 3.9 (chosen randomly), especially "INTEGER" in the middle.</li>
</ol>
<pre><code>SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
sqlite3 *db, /* Connection handle */
const char *zDbName, /* Database name or NULL */
const char *zTableName, /* Table name */
const char *zColumnName, /* Column name */
char const **pzDataType, /* OUTPUT: Declared data type */
char const **pzCollSeq, /* OUTPUT: Collation sequence name */
int *pNotNull, /* OUTPUT: True if NOT NULL constraint exists */
int *pPrimaryKey, /* OUTPUT: True if column part of PK */
int *pAutoinc /* OUTPUT: True if column is auto-increment */
){
(snip)
/* The following block stores the meta information that will be returned
** to the caller in local variables zDataType, zCollSeq, notnull, primarykey
** and autoinc. At this point there are two possibilities:
**
** 1. The specified column name was rowid", "oid" or "_rowid_"
** and there is no explicitly declared IPK column.
**
** 2. The table is not a view and the column name identified an
** explicitly declared column. Copy meta information from *pCol.
*/
if( pCol ){
zDataType = pCol->zType;
zCollSeq = pCol->zColl;
notnull = pCol->notNull!=0;
primarykey = (pCol->colFlags & COLFLAG_PRIMKEY)!=0;
autoinc = pTab->iPKey==iCol && (pTab->tabFlags & TF_Autoincrement)!=0;
}else{
zDataType = "INTEGER";
primarykey = 1;
}
(snip)
/* Whether the function call succeeded or failed, set the output parameters
** to whatever their local counterparts contain. If an error did occur,
** this has the effect of zeroing all output parameters.
*/
if( pzDataType ) *pzDataType = zDataType;
if( pzCollSeq ) *pzCollSeq = zCollSeq;
if( pNotNull ) *pNotNull = notnull;
if( pPrimaryKey ) *pPrimaryKey = primarykey;
if( pAutoinc ) *pAutoinc = autoinc;
(cut)
</code></pre>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/Perl5/DBIx-Class/pull/142#issuecomment-1016889073">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AACJ4AS4N3UQ53MSOKWXRG3UW4VFJANCNFSM5MJAUXDQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AACJ4AXFTRNE2PLHBBM46PTUW4VFJA5CNFSM5MJAUXD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHSOH54I.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><Perl5/DBIx-Class/pull/142/c1016889073</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/Perl5/DBIx-Class/pull/142#issuecomment-1016889073",
"url": "https://github.com/Perl5/DBIx-Class/pull/142#issuecomment-1016889073",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>