cancel
Showing results for 
Search instead for 
Did you mean: 

Support for builtin functions like COMPRESS or ENCRYPT as client-side functions

VolkerBarth
Contributor
3,646

Based on this question and other situations, I'd like to ask if there have ever been plans to support some of SQL Anywhere's builtin functions as client-side functions, too.

I'm refering to functions like COMPRESS/DECOMPRESS, ENCRYPT/DECRYPT, HASH and others - functions that might be useful outside queries, too. That's what I mean by "client-side": They should be usable without a query that is processed on the database engine. I have no clear idea of the API I'm thinking of - possibly like the DBTools API, but without having to connect with a database.

Those functions should work the same way as the builtin ones (i.e. compressed or encrypted data should be interchangeable, independent whether it was done client-side or server-side). So they could be used instead of typical third party libraries.

Possible use cases would be

  • to compress huge data on the client before it's sent to the server (as in the question cited above)
  • to encrypt/hash credentials or other sensitive data
  • to encode data with BASE64_ENCODE or use HASH to build CRC32 check sums.

As stated, I'm aware that there are lots of third party libraries for these tasks - on the other hand, it seems handy if one could use these fine builtin functions for "outside" tasks, too.

Accepted Solutions (1)

Accepted Solutions (1)

graeme_perrow
Advisor
Advisor

No, this has never been requested by anyone else and we have no plans to add this support. I'm not sure I see the point of doing this on the client side. We already support compression and encryption of the connection, so your top two possible use cases are moot. I'm not sure what purpose your third use case would serve - are you concerned with data being corrupted?

VolkerBarth
Contributor

Well, that's a clear statement:)

Note that I do not think that my top two points are that moot - obviously due to having specified them rather vague:

  1. As to compression: I had the impression from the cited question that connection compression is not as effective as the COMPRESS function for bigger data. If I'm wrong than that point is moot, apparently.

  2. I'm thinking of using encryption to store client-side data (not the given credentials sent to the server) - so they usually would need to be decrypted before a connection is available to do so. (I'm aware that this leads to the "key" question how a key is stored/hidden/whatsoever.)

But of course I appreciate that this suggestion seems quite exotic:)

Answers (1)

Answers (1)

VolkerBarth
Contributor

FWIW, the great Breck has shown in a great article on his great blog how to simulate such hypothetical client-side functions with a local "dummy" database.

Not really what I was asking for but a possible workaround - as long as there's a local database engine on the client-side, too...