There is no documented way to edit an InDesign document without InDesign. Its internal file format is proprietary ("manufactured and sold only by the owner of the patent, formula, brand name, or trademark associated with the product").
The InDesign SDK does not target the actual file data, as it's meant to help developing plugins that run inside InDesign itself. It only documents the internal state of ID while running.
IDML provides an XML representation of an InDesign document, and that can be edited with the usual toolkits. However, an IDML file still needs to be read in, parsed, and formatted using InDesign itself. Also, IDML provides for content markup and editing, but the result of any changes in that content or formatting can only be seen after opening the file with InDesign. For example, while you can replace a short text with a much longer, or a small font with a larger, you can not 'see' whether it will fit in the originally allocated space or not.
Disclaimer: the following is conjecture of my own. Use At Your Own Risk, Et Cetera.
With the above said: yes, you are correct. The message about 'a database error' is indeed what you get after manually editing an InDesign file. (Note for future posts: please, never state that "an error" was reported. Always state the exact error text!)
ID files are stored in a relational database format, where the actual data has been split up into 4K large "pages". Each page contains a 4-byte checksum at the very end, at offset 0xFF8
, which seems to be a variant of Adler-32. I've found it's not easy to calculate it, but you can set the checksum to all zero's, which seems to indicate that it's not used. Your file will open as usual in InDesign, and after saving you will see the checksum updated.
Note that manually editing binary files is, very emphatically, not recommended. You cannot insert or delete text, only overwrite it. Text may not be stored sequentially, or in the code page you expect it to be. Not all text you can find in the binary may be visible, or even used at all, in InDesign itself; also, in reverse, not all text you can see in your document while in InDesign may be stored as such in the binary.