View Full Version : Notes
fishcube
02-29-2008, 10:48 AM
Is there any limit to how long the notes are? I'm entering a database. And when I used to use contacts for notes, the notes field stopped after so much text.
BlackWolf
02-29-2008, 11:00 AM
Is there any limit to how long the notes are? I'm entering a database. And when I used to use contacts for notes, the notes field stopped after so much text.
the notes are based on sqlite and I guess the fields are TEXT fields. unfortunatly, I cannot find any info on how large a text-field in sqlite can be. I'll look around ...
edit: there we go ...
The maximum number of bytes in a string or BLOB in SQLite is defined by the preprocessor macro SQLITE_MAX_LENGTH. The default value of this macro is 1 billion (1 thousand million or 1,000,000,000).
The current implementation will only support a string or BLOB length up to 2^(31)-1 or 2147483647.
since a billion bytes are nearly a gigabyte, I really can't imagine you wrote that much, but maybe apple lowered that max value, I don't know.
fishcube
02-29-2008, 11:18 AM
I have 1777 entries, one entry per line.
BlackWolf
02-29-2008, 12:26 PM
I have 1777 entries, one entry per line.
if I'm not mistaken any line would need over 550000 characters to exceed the billion-byte limit in that case.
but I guess apple just created some limits of their own.
daihard
03-01-2008, 06:55 AM
since a billion bytes are nearly a gigabyte, I really can't imagine you wrote that much, but maybe apple lowered that max value, I don't know.
I seriously doubt they use the BLOB data type for notes. If they do, they must have changed the value of the SQLITE_MAX_LENGTH macro to something significantly lower. Remember, you need at least 1GB space to store one-billion byte text!
BlackWolf
03-01-2008, 07:11 AM
I seriously doubt they use the BLOB data type for notes. If they do, they must have changed the value of the SQLITE_MAX_LENGTH macro to something significantly lower. Remember, you need at least 1GB space to store one-billion byte text!
well yes and no. I mean if the user types in a gigabyte of text it takes up a gigabyte of space on the iphone/ipod touch. not really apples problem to care about that :D but I guess we'll never know how they did it.
daihard
03-01-2008, 07:29 AM
well yes and no. I mean if the user types in a gigabyte of text it takes up a gigabyte of space on the iphone/ipod touch. not really apples problem to care about that :D but I guess we'll never know how they did it.
I may be mistaken, but doesn't Apple limit the space the applications can use? My iPod touch has 16GB disk space, but I don't think the sqlite engine can use all of it. Besides, as you may know, the purpose of BLOB is mainly storing opaque data, such as images, audio and what not. If I were the designer of the notes app, I'd definitely use the standard CHAR (or TEXT) data type.
But you're right, we'll never know how Apple did it. :)
BlackWolf
03-01-2008, 08:19 AM
I may be mistaken, but doesn't Apple limit the space the applications can use? My iPod touch has 16GB disk space, but I don't think the sqlite engine can use all of it. Besides, as you may know, the purpose of BLOB is mainly storing opaque data, such as images, audio and what not. If I were the designer of the notes app, I'd definitely use the standard CHAR (or TEXT) data type.
But you're right, we'll never know how Apple did it. :)
I don't know if the apps are limited, but seems likely to me especially with the upcoming SDK and everything.
and btw: where did you read something about blob? I always stated that apple likely uses TEXT data type fields, I never said anything about BLOBs :D