Closed adamdecaf closed 6 years ago
Thanks @zellyn! I was able to get a quick example working after this patch.
Edit: chrome works too
Ok cool. I should be able to add a real db test with https://github.com/go-sqlite/sqlite3/pull/18, but could look into one now though.
Could #18 be merged first? Or would you want a specific test for this? btree.go could use splitting calls up into smaller functions for easier testing.
Could #18 be merged first?
agreed.
btree.go could use splitting calls up into smaller functions for easier testing.
SGTM
I added a quick test after dumping the tables. Here's the view I see from dumping each header.
I'm not seeing any integer types other than StInt8
.
Thoughts on the test? Hopefully it's not too jank. More are easy to add.
I think I would first try to find a SQLite file with those pesky StInt24
and StInt48
numbers in (or directly create one), extract by visual inspection what the raw byte representation for those would look like and add a simple test for unmarshalling these (so, deconnected from the whole btree business)
and then, perhaps, add that simple SQLite file to the mix of testdata files.
I think I would first try to find a SQLite file with those pesky StInt24 and StInt48 numbers in (or directly create one)
Created in https://github.com/go-sqlite/sqlite3/pull/19/commits/75da510445b5cacf329005bb0edd9bbe400ed0cb
I went ahead and pulled the integer reads into new functions and have a test for them. I'm not sure our reads are correct though.
extract by visual inspection what the raw byte representation for those would look like and add a simple test for unmarshalling these
Is that some tool? I've only ever used the cli sqlite3 client.
extract by visual inspection what the raw byte representation for those would look like and add a simple test for unmarshalling these
Is that some tool? I've only ever used the cli sqlite3 client.
no, I was just aluding to looking at a hexdump
of a file containing those numbers and devise a few test cases.
essentially what you did :)
I was trying to read
moz_places
from a firefox sqlite db and ran into a panic.