-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define--> What does undefine() and define_free() actually do? #73
Comments
Quoting the docs: To delete a scalar function, execute
|
Ah, I did not appreciate that the sqlean_define table is permanent, and survives reconnect. Is there a way to make the table Temporary, so that each connection has its own private set of defined functions, that disappear on disconnect? |
Not at the moment. Why would you need it, what is your use case? |
Similar to using a Temporary View, to make following SQL simpler and clearer, without two independant connections (with possibly different versions of the View) interfering with each other. |
Not sure I understand. What prevents you from using the same function from two different connections? How would they interfere? |
An example might be a Distance() function that includes a conversion into desired display units (Miles versus km vs yards vs meters, say). Two connections to the same db might be set for different display units. Each connection would want to be able to define the distance() function differently, and be able to change it freely. |
I'm sure we can come up with a lot of hypothetical scenarios like the one you mentioned. But do you have a specific use case in your real work? |
I'll be happy to revisit this issue when there's a real use case. |
Hi, I have this confusing behaviour (using a compiled for 32-bit define.dll):
select define('sumn', ':n * (:n + 1) / 2');
select sumn(5); --> 15
select undefine('sumn');
select define_free();
select sumn(5); --> '15'
Why does the defined function still work if I have undefined and called define_free? I checked that the 'sumn' function is properly deleted from the sqlean_define table.
The text was updated successfully, but these errors were encountered: