-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add StoredProcedure #97
Comments
If you can fit it into a 'call': tink_sql/src/tink/sql/Query.hx Line 17 in 2602205
tink_sql/src/tink/sql/Query.hx Lines 49 to 53 in 2602205
You can then format it accordingly in the sqlserver formatter: tink_sql/src/tink/sql/format/MySqlFormatter.hx Lines 147 to 156 in 2602205
|
The way I see it now, there will be a lot of confusing naming overlap that will get cumbersome. I'm thinking of using new metadata (while still allowing old one But new meta: (or if you prefer, use something like Then I can just add a field enum CallType {
Proc;
Func;
} From there, in the formatter, I can decide whether it's a stored procedure or a function, etc.. and, I think since it's optional, it shouldn't break any existing code (though, I don't know if MySQL also has SPs, probably does, but if so, I guess in the future it may be worthwhile to implement EDIT: Also, I think the SQL parameter name part is optional, so I don't think there's a need for any added complexity there either. |
I think @kevinresol is the best person to weigh in here. In any case I wouldn't worry about breaking some metadata, it's easy to update and I feel adding more drivers will result in breaking changes anyway. |
Is it like |
No an SP can actually return multiple things whereas a function can only return one (hence SP isn't meant to be called within SQL by other SQL, but I wouldn't worry about that outside the restriction that it can't be used in sub queries. No one really uses SPs with multiple returns really.. it's clumsy and pointless but possible). |
So yeah, |
Functions are dealt with |
In SQL Server, SPs can manipulate data, whereas what other DBs call Procedures MSSQL calls Functions, and those are basically just parametrized queries referenced by name.
Stored Procedures can compose functions and queries and also return a resultset, the general use is much like a function, so, I think the only real difference would be the calling convention.
In SQL Server, it's
I'm willing to put in the work to do this as I am planning to write an ODBC driver soon (for HashLink).
What's the best path to implement without duplicating a bunch of code? It's basically going to require all the same inputs and give the same output as Procedures (both at runtime and in macro).
With the added restriction (if it doesn't already exist) that you can't compose SP calls (I don't know if tink SQL allows procedure calls in subqueries but yeah, no go with SPs)
The text was updated successfully, but these errors were encountered: