Is there a way to check how much space a single row takes in Sqlite?
I have tried using this way:
I have 4 fields in my table:
id(int)
name(text)
pat(text)
is_default(bool)
select *, sum(length(id)+length(name)+length(pat)+length(is_default))
from color;
But it returns character length (for example: 43). How can I determine the row length in bytes?
SQLite itself does not give you this information, but the sqlite-analyzer tool does.
If you want to do this from your app, you have to read all the record values and from those deduce how many bytes are used in the on-disk record format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With