When using psql, if a datebase includes null column values, I see random corruption of results, which at first I thought was caused by something I was doing, but on investigation seems to be related to null columns.
To reproduce, start with dbtest/pg.go, insert a few records, then add a column say:
to the struct, and add it to the database with:
alter table userinfo add column rank integer;
Then try selectAll and selecting all rows (inserting quite a few and setting a limit of 100 rather than 10 might make it easier to see). The results below have two ints added, one which was filled in, and one which was left blank (null).
Results are returned with seemingly random columns blanked out, e.g. for this:
uid | username | departname | created | rating | rank
-----+---------------+-----------------------------+------------+--------+------
1 | Test_Add_User | Test_Add_Departname | 2011-12-12 | 12 |
2 | Test_Add_User | Test_Add_Departname | 2011-12-12 | 12 |
3 | Test_Add_User | Test_Add_Departname | 2011-12-12 | 12 |
4 | Test_Add_User | Test_Add_Departname | 2011-12-12 | 12 |
5 | Test_Add_User | Test_Add_Departname | 2011-12-12 | 12 |
6 | Test_Add_User | Test_Add_Departname | 2011-12-12 | 12 |
7 | Test_Add_User | Test_Add_Departname | 2011-12-12 | 12 |
8 | Test_Add_User | Test_Add_Departname | 2011-12-12 | 12 |
You'd see this result in the Structs returned, and the result changes in a seemingly random way with every request (even if requests are from sequential runs of the app, not from the same process) - N is username, and D is departname, as you can see random fields are blanked out instead of the null column :
N:Test_Add_UserD:
N:Test_Add_UserD:Test_Add_Departname
N:Test_Add_UserD:
N:Test_Add_UserD:
N:Test_Add_UserD:
N:Test_Add_UserD:Test_Add_Departname
N:D:
N:D:
N:D:
N:D:
Then try setting the rank columns in psql so that nothing is null:
update userinfo set rank=14;
And try requesting the records again, and you get the full records.
I think this might be the cause of #11 - null fields in the db - beedb seems to have a problem at present handling any table with a null value in it.