[EMAIL PROTECTED] <[EMAIL PROTECTED]> writes: > > > On Jun 17, 9:07 pm, "David Crawshaw" <[EMAIL PROTECTED]> wrote: > > 2008/6/18 [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > > > > Ok, perhaps it needs to wait until the C api matures a bit. One other > > > observation though, if I may. DatabaseMetaData.getColumns() returns > > > yet another data type code: > > > > Ah, good catch. That function is parsing the results of pragma > > table_info(), which sadly just returns whatever type name the user > > gave, even if it's nonsense. So it catches int/integer and float, and > > otherwise returns a varchar. This too, is highly questionable > > behaviour. I'm not really sure what would be the best thing to do > > here. > > I thought I might be onto something when I noticed > sqlite3_column_decltype > in the C API. I changed line 145 in NestedDB.java to use > sqlite3_column_decltype instead of > sqlite3_column_type, and rebuilt the driver. That yields something > other than SQLITE_INTEGER > as the java type code is 12 (Types.VARCHAR) and my debug statement > indicates that > sqlite3_column_decltype is returning 1340304. For now, I think I'll > try to simply map the > column type name to a java Types constant and use that as the type > code. If the user wants > to have an imaginary column type, we'll treat it as a VARCHAR. Thanks > for your help. > > Rob
First: sorry for my english. I disaggree that returning type which user typed is "highly questionable". For me it was "hightly usable". I have libraries for creating forms and views. I have special classes for text / varchar/ date fields. Other databases - like Postgre allows to set different data types for fields like "varchar" or "text", so i use this library for sqlite and for them. Until v52 my library worked perfectly - it could read field type from base and set proper default field format for it. But it has ened now. I set field type (or just named it) for "date", but i get "text". I have "varchar(64)" wchich means - one line field, but i have text... I looked at your post date and got v50, so i have this working again. PLS - change it back. Or - if ruining so good option because some users may be stupid and call database types "hello" - can someone tell mi HOW to get data type which user entered? > > > --~--~---------~--~----~------------~-------~--~----~ Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en To unsubscribe, send email to [EMAIL PROTECTED] -~----------~----~----~----~------~----~------~--~---
