On Oct 10, 1:28 pm, Nate Wiger <[email protected]> wrote: > So I've been playing with Sequel and really like it. Despite some > conflicting info on the web, though, it appears the Oracle driver does > NOT currently have support for bind variables. I'm basing that on > this:
That's still the case. There is emulated support, but no native support for bound variables/prepared statements in the Oracle adapter. If you are connecting to Oracle via JDBC (e.g. using JRuby), you can use the JDBC support. > From an initial reading of the Sequel codebase, it appears there is > now support to pass bind variables around, since postgres.rb appears > to do this in most (all?) cases. The postgres, mysql, sqlite, and jdbc adapters have supported bind variables and/or prepared statements natively since 2.4. > So my actual question is: If I cut-and-paste the postgres.rb > functions that do stuff with bind variables, should this be sufficient > to add bind support in all cases? Or are there other pieces that need > to be modified in the higher-level sequel.rb functions? I don't quite > grok sql.rb yet, so I'm not sure if there are any lingering hardcoded > sql strings that need to become @sql, @args. It's probably more than a simple cut and paste job, but I'm sure support could be added. I don't have access to an Oracle installation, so I haven't tried to add native bound variable/prepared statement support. The integration tests test the prepared statement support fairly well, so if you can get those to pass, support should be pretty decent. > BTW - really like the codebase so far. I tried adding bind variable > support to AR and felt like I wanted to stab myself in the face. I'm glad you are finding the codebase easy to work with. I certainly try to keep it clean and understandable. The prepared statement support is some of the hardest to understand code in Sequel, since it had to be hacked in fairly late in it's development. If you have any specific questions about it, please ask here. Honestly, after getting it to work in 2.4, I haven't looked at or modified it much since. Note that in Sequel, bound variables/prepared statements are never used unless you specifically call Dataset#prepare or Dataset#call. I'm not sure if that is mentioned specifically in the documentation. Jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
