There is a undocumented function $assignments(). Make this one an official function
Assumption: You have to know exactly the number of bytes written to database. If there is a linefeed in string, this number depends on the $NEW_LINE setting. How to get this setting withou t$assignments() ?