On Wed, Apr 3, 2019 at 2:31 PM Lifepillar <lifepil...@icloud.com> wrote:
> [I hope that this kind of announcement is not off-topic here] > Not at all, IMHO. > SQLite3 Decimal is an extension implementing exact decimal arithmetic > for SQLite3. It is currently unfinished and under development. I'm curious, what was your motivation for doing this? Use cases envisioned for its use? > Decimals are stored as blobs and the storage format is a minor variant > of decimalInfinite (https://arxiv.org/abs/1506.01598). Does it use some kind of magic cookie? How can you distinguish your encoding from an arbitrary blob? Unfortunately, SQLite does not support UDTs, but it did grow in recent months the https://www.sqlite.org/c3ref/value_subtype.html API, which plays a poor-man's substitute when call chaining. That OTOH has no influence on how the value will be *stored in tables*, unfortunately, so you cannot have alternate representation of the value, one optimized for storage, another for processing (in call chains), so maybe it's all moot, mentioning this. That is a totally > ordered encoding, so decimals can be compared directly (memcmp()) and > also indexed (does SQLite support indexes on blobs?). > Yes it does. > As I have said, I welcome any feedback, from the super-technical to the > end-user oriented. There is no manual so far, but the code is mostly > documented. You may find a sample session in the repository's home page. > From an End-User POV, the call-chained-functions are "heavy looking". So maybe a printf-like API that parses a now-looking math expression and replaces its placeholders with the var-arg supplied arguments to the function would make the "SQL" much more readable. Since you cannot extend the regular arithmetic expressions in SQLite to act on your UDTs differently than the built-in processing, that would be the next best thing IMHO. All in all, it looks very well done. You're obviously a very competent programmer IMHO :). Thanks, --DD PS: Seems like you're using non-ascii chars in your source code, notably the #pragma mark. That's pretty, but asking for trouble IMHO, and likely to cause issues for cross-platform support. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users