-
Notifications
You must be signed in to change notification settings - Fork 61
Added basic pipeliened functions support #31
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
Conversation
-- .gitignore I use RubyMine so it creates it's .idea work directory. -- package.rb Create several class method for object searching. Just for clarity Package object now can return procedures or types by “find” method. If there are FIND procedure then last will be called (still can use __find__ synonym). -- pipelined_function.rb Inherited from Procedure class (but I think both of them should be inherited from Subprogram). Three finders and custom “exec” method. That's all. -- pipelined_function_call.rb Custom SQL building and data fetching. -- procedure.rb Find method rewritten. All queries now use ALL_PROCEDURES (with filter by PIPELINED field). -- procedure_call.rb Code moved to subprogram_call.rb. Only SQL construction and execution was left (and DBMS_OUTPUT as well for a while). -- subprogram_call.rb Just all good stuff from ProcedureCall but refactored a bit. I tried to dry it. -- ruby_plsql.rb Add new files for requiring. -- spec_helper.rb I have to insert DATABASE_USE_TNS_NAMES environment variable for correct testing. I always use TNS_NAMES and SSH tunnels to connect to Oracle. So I must leave host and port empty.
|
Thanks for this proposal and changes but I need to find time to review it :) One thing that I noticed is usage of |
|
Good idea. I'll do it. |
Also added pipelined function support to Schema class
|
[] method added. |
Disabled creation global type to pipelined function
|
Looks like large piece of nice work. Due to the large rework done, it's not easy to review it, but it might be worth a second try. |
|
Oh. It will take a while :) If I remember it correctly one large part of the PR is consist of trivial code movement and the other one is refactoring of procedure-call related code in a more OOP-ish style. I understand that it's difficult to read and accept all at once but back in those days my time was limited. Sorry about that :) |
|
Do you think it would be better to split it into several pieces of rework? |
|
Yep, sure. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi Raimonds!
At my work I have a lot of pipelined functions that generates small sets of data. Everyone of them take parameters (e.g. user_id) and returns a list of rows (see my spec for example). It it very convenient API between our Oracle DB application and RoR interface. So I plan to create a gem that will alllow to set a pipelined function as standard ActiveRecord table. I think it's better than reinventing the wheel.
First of all I need a list of arguments and return type description of function so I took your gem and change code of procedure calls. I have to refactored it a little bit :)
And sorry for my English :)
My changes:
.gitignore
I use RubyMine so it creates it's .idea work directory.
package.rb
Create several class method for object searching. Just for clarity
Package object now can return procedures or types by “find” method. If
there are FIND procedure then last will be called (still can use
find synonym).
pipelined_function.rb
Inherited from Procedure class (but I think both of them should be
inherited from Subprogram). Three finders and custom “exec” method.
That's all.
pipelined_function_call.rb
Custom SQL building and data fetching.
procedure.rb
Find method rewritten. All queries now use ALL_PROCEDURES (with filter
by PIPELINED field).
procedure_call.rb
Code moved to subprogram_call.rb. Only SQL construction and execution
was left (and DBMS_OUTPUT as well for a while).
subprogram_call.rb
Just all good stuff from ProcedureCall but refactored a bit. I tried to
dry it.
ruby_plsql.rb
Add new files for requiring.
spec_helper.rb
I have to insert DATABASE_USE_TNS_NAMES environment variable for correct
testing. I always use TNS_NAMES and SSH tunnels to connect to Oracle. So
I must leave host and port empty.