def []=(attr, value)
case attr
when 'AutoCommit'
if @attr['AutoCommit'] != value then
if value
if @in_transaction
_exec("COMMIT")
@in_transaction = false
end
else
@in_transaction = false
end
end
when 'NonBlocking', 'pg_async'
value = value ? true : false
@pgexec = (value ? DBI::DBD::Pg::PgExecutorAsync : DBI::DBD::Pg::PgExecutor).new(@connection)
when 'pg_client_encoding'
@connection.set_client_encoding(value)
when 'pg_native_binding'
@attr[attr] = value
else
if attr =~ /^pg_/ or attr != /_/
raise DBI::NotSupportedError, "Option '#{attr}' not supported"
else
return
end
end
@attr[attr] = value
end