[SQL-CVS] SQLObject/docs FAQ.txt,1.2,1.3
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <ian...@us...> - 2003-09-07 19:14:46
|
Update of /cvsroot/sqlobject/SQLObject/docs In directory sc8-pr-cvs1:/tmp/cvs-serv1609/docs Modified Files: FAQ.txt Log Message: Added FAQ about binary files Index: FAQ.txt =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/docs/FAQ.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FAQ.txt 7 Sep 2003 18:19:25 -0000 1.2 --- FAQ.txt 7 Sep 2003 19:14:43 -0000 1.3 *************** *** 154,155 **** --- 154,177 ---- This restriction will probably be removed soon. + + Binary Values + ------------- + + Binary values can be difficult to store in databases, as SQL doesn't + have a widely-implemented way to express binaries as literals, and + there's differing support in database. + + A possible way to keep this data in a database is by using encoding. + Base 64 is a good encoding, reasonably compact but also safe. As + an example, imagine you want to store images in the database: + + .. raw:: html + :file: ../examples/snippets/image-binary.html + + SQLite does not respect backslash quoting, so for instance ``\n`` is + not interpreted as a newline. For the moment there's no resolution, + and this will mess up your base64-encoded values. As a workaround: + + .. raw:: html + :file: ../examples/snippets/image-binary-sqlite.html + |