I've got a SQLite database. I'd like to create a field and declare it as type Byte array but I don't know what SQLite calls something that would be of type Byte Array. How would I do this?
In relational databases generally, an array is used to store rows with different key columns as an array dimension that means more than one key for a particular key. But in SQLite we cannot directly implement arrays in SQLite.
A blob is a SQLite datatype representing a sequence of bytes. It can be zero or more bytes in size. SQLite blobs have an absolute maximum size of 2GB and a default maximum size of 1GB. An alternate approach to using blobs is to store the data in files and store the filename in the database.
sqlite > dbinfo. sql will give you detail info on each table's size on disk.
SQLite cannot store binary data (i.e., strings containing NUL or ' characters) unless it is first encoded to remove these characters. The sqlite. encode() function compactly encodes binary strings so that they can be safely stored in an SQLite database.
You're looking for BLOB.
From the webpage:
BLOB - The value is a blob of data, stored exactly as it was input.
Here's an example of making a table with two columns - an id and some data, which is a BLOB:
CREATE TABLE t1 (id INTEGER PRIMARY KEY, data BLOB);
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