[Gambas-user] Bug in Database manager
kobolds
kobolds at ...2041...
Mon Jul 6 21:36:57 CEST 2009
Benoît Minisini wrote:
>
>> gambas 2.14
>> database sqlite
>>
>> I create table with 2 datetime fields (start_date , end_date) and default
>> value current_timestamp . and 1 string field (stg_status) with default
>> 'O'
>>
>> when I open using gambas database manager
>> the 2 datetime field show ,
>> start_date --> default show --> 0
>> end_date---> default show --> 8980056
>>
>> the string field stg_status --> default show --> 4.444578977261E-317
>>
>> I also found very strange limitation in database manager . if you manual
>> create a table from sqlite konsole . if you type like this :
>> create table testtbl( std_id integer primary key autoincrement , std_name
>> text);
>>
>> sqlite execute no problem but when you open using database manager , it
>> give error no primary key
>>
>> you must type
>> create table testtbl( 'std_id' INTEGER PRIMARY KEY AUTOINCREMENT ,
>> 'std_name' TEXT);
>>
>> why such weird limitation exist ?
>
> You must create your tables from the database manager if you want him to
> display them reliably. As there is no standard way in SQL to store
> metadata in
> a database, the gambas database component relies on specific database-
> dependant datatype to do its mapping with Gambas native datatypes.
>
> See http://gambasdoc.org/help/doc/db-type-mapping for more details.
>
> In your specific case, I think there is a case-sensitive comparison
> somewhere
> in the sqlite database driver that should be case-unsensitive. I will
> investigate and try to fix the problem.
>
> Regards,
>
> --
> Benoît
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
what I mention is also happen when you using the database manager to create
the table and the default value . this happen if the field type is string .
create a table (sqlite) using database manager . create a field type string
. enter the default value 'O' .save . refresh /reload . the default value
for the string change to number (the number change each time you open the
database manager).
if you check the schema of the table from sqlite konsole , it show correct
the default 'O' .
if you want to enter data into the table using database manager you will see
default (random number) field into it rather than 'O' .
--
View this message in context: http://www.nabble.com/Bug-in-Database-manager-tp24358215p24361573.html
Sent from the gambas-user mailing list archive at Nabble.com.
More information about the User
mailing list