No commit activity in last 3 years
No release in over 3 years
This library changes the query to parameterized query automatically.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.1
>= 12.3.3
~> 3.1

Runtime

 Project Readme

OCI8 Auto binder

Build Status

This library changes the query to parameterized query automatically.

Installation

Add this line to your application's Gemfile:

gem 'oci8-auto-binder'

And then execute:

$ bundle

Or install it yourself as:

$ gem install oci8-auto-binder

Usage

OCI8AutoBinder.replace_original_class!
conn = OCI8.new(username, password, ident)
conn.exec("select * from table1 where column1 = 1") do |r|
  # change to prarameterized query automatically in exec method
  # query = "select * from table1 where column1 = :a0", params = {:a0 => 1}
  puts r.join(',')
end
conn.logoff

logging parameterized query and parameters

OCI8AutoBinder.replace_original_class!
OCI8AutoBinder.logger = Logger.new(log_file_name)
OCI8AutoBinder.logger.level = Logger::INFO    # save all log(FOUND_BINDVARS, PARSE_ERROR, NO_PARAMS, PARSE_SUCCESS)
OCI8AutoBinder.logger.level = Logger::ERROR   # save parse error log(PARSE_ERROR)
OCI8AutoBinder.logger = nil                   # do not save logging

Contributing

Bug reports and pull requests and PARSE_ERROR query are welcome on GitHub at https://github.com/jksy/oci8-auto-binder.