As of Zeos 6.6.2rc, blobs are saved in SQLite 3 as string with a custom escaping. This is not per SQLite 3 specification, that recommends the X'0123456789ABCDEF' SQL standard notation for blobs. Saving data with this format switches the field data type to blob instead of string, and is more efficient for both storage and performance. Moreover, this allows to share the database with other applications written in different languages, or using different toolkits, but conforming to the SQLite specification (or SQL-92 in general).
Changing the write part is trivial: just change ZDbcSqLiteUtils.EncodeString to a 4-line function using BinToHex, although prepared statements would do better.
Changing the read part is more complex, because native blobs may include null bytes, and the current implementation assumes null terminated values. A separate "field length" value would be needed for this, and I've not found it in the code.
In order to avoid breaking existing Zeos-based applications, a compile-time define or run-time parameter/property could be used to retain the "legacy" (escaped string) behavior or the standard SQL one.
SQLite 3 blob encoding
Freature requests from users for ZeosLib's DBOs
Moderators: gto, cipto_kh, EgonHugeist, mdaems
Jump to
- Links
- ↳ Bugtracker
- ↳ Downloads
- ↳ Subversion
- ↳ GitHub
- ZEOS Library - General
- ↳ Announcements
- ↳ Downloads
- ↳ Documentations
- ↳ Tutorials
- ↳ ZDBC (ZEOS Database Connectivity)
- ↳ User Contributions
- ↳ Feature Requests
- ↳ User Patches
- ZEOS DBO v8.x
- ↳ ZeosLib 7.3/8.0 Forum
- ZEOS DBO v7.x
- ↳ ZeosLib 7.2 Forum
- ↳ ZeosLib 7.1 stable Forum
- ↳ ZeosLib 7.0 Stable Forum
- ↳ ZeosLib 7.0 Beta Forum
- SQL Servers and Databases
- ↳ ADO
- ↳ DB2
- ↳ Firebird
- ↳ Interbase
- ↳ MS SQL Server
- ↳ MySQL
- ↳ Oracle
- ↳ OleDB (Microsoft Windows)
- ↳ ODBC
- ↳ PostgreSQL
- ↳ SQLite
- ↳ Sybase ASE
- Compiler related
- ↳ CBuilder / C++
- ↳ Lazarus / Freepascal
- ZEOS DBO V 6.x
- ↳ 6.6 - stable
- ↳ 6.5.1 (alpha) - 6.6.x (beta)
- ↳ 6.1.5
- ↳ Other 6.x Versions
- ↳ Bug Reports
- ZEOS DBO V 5.x
- ↳ 5.x Versions
- Software projects using ZeosLib
- ↳ SQLite Administrator
- Other and Non-Technical
- ↳ Off Topic