little-brother / sqlite-gui

Lightweight SQLite editor for Windows
GNU General Public License v2.0
1.09k stars 52 forks source link

Numeric columns alignment #145

Closed sergioferrari closed 1 year ago

sergioferrari commented 1 year ago

Hi Little Brother, I am using sqlite-gui to work on a sqlite3 database and I notice that several columns, with numerical values of the same type (INTEGER or REAL), are aligned sometimes left and sometimes right. I attach two screenshots. In my opinion the columns with numeric values (both INTEGER and REAL) should all be aligned to the right, while the columns containing TEXT should be aligned to the left. I take this opportunity to congratulate you for your program, really well done and with many interesting features.

integers reals
little-brother commented 1 year ago

Thanks for the report!

As I can see you encountered with an incorrect aligment in a view. How is this column calculated? Do you have the same issue in a table? What has datatype column in the source table?

The alignment is defined by a column type returning SQLite. I suppose that sometime (e.g. in your cases) SQLite couldn't do it correctly because the column uses mixed types and SQLite returns NULL.

I take this opportunity to congratulate you for your program, really well done and with many interesting features.

Thanks :)

P.S. I have already reproduced the issue with select value, case when random() < 0 then 1.0 else null end from generate_series(1, 10, 1)-query. The fix is coming soon.

sergioferrari commented 1 year ago

The screenshot above is from a table (not a view). The columns of INTEGERs are foreign keys and both refer to the (ID) of the same table. Here's the code:

table_fornitori

The screenshot below is of a view. The columns of real numbers come from two different columns (both REAL) of the same table. Here's the code:

view_conto_corrente
little-brother commented 1 year ago

Fixed.