首页
/ ActiveRecord Oracle Enhanced Adapter 技术文档

ActiveRecord Oracle Enhanced Adapter 技术文档

2024-12-23 23:24:46作者:咎竹峻Karen

1. 安装指南

依赖环境

  • Ruby on Rails 版本:2.3.x - 7.0
  • Oracle 数据库版本:10g 及以上

安装步骤

根据您使用的 Rails 版本,在 Gemfile 中添加相应的依赖:

  • Rails 7.0:

    gem 'activerecord-oracle_enhanced-adapter', '~> 7.0.0'
    
  • Rails 6.1:

    gem 'activerecord-oracle_enhanced-adapter', '~> 6.1.0'
    gem 'ruby-oci8' # 仅限 CRuby 用户
    
  • Rails 6.0:

    gem 'activerecord-oracle_enhanced-adapter', '~> 6.0.0'
    gem 'ruby-oci8' # 仅限 CRuby 用户
    
  • Rails 5.2:

    gem 'activerecord-oracle_enhanced-adapter', '~> 5.2.0'
    gem 'ruby-oci8' # 仅限 CRuby 用户
    
  • Rails 5.1:

    gem 'activerecord-oracle_enhanced-adapter', '~> 1.8.0'
    gem 'ruby-oci8' # 仅限 CRuby 用户
    
  • Rails 5.0:

    gem 'activerecord-oracle_enhanced-adapter', '~> 1.7.0'
    gem 'ruby-oci8' # 仅限 CRuby 用户
    
  • Rails 4.2:

    gem 'activerecord-oracle_enhanced-adapter', '~> 1.6.0'
    
  • Rails 4.0 和 4.1:

    gem 'activerecord-oracle_enhanced-adapter', '~> 1.5.0'
    
  • Rails 3:

    gem 'activerecord-oracle_enhanced-adapter', '~> 1.4.0'
    

如果您希望使用 GitHub 上的最新版本,可以指定:

gem 'activerecord-oracle_enhanced-adapter', :git => 'git://github.com/rsim/oracle-enhanced.git'

安装完 Gemfile 中的依赖后,运行以下命令:

bundle install

2. 项目的使用说明

在使用 ActiveRecord 与 Oracle 数据库的连接时,您需要在 config/database.yml 文件中配置相应的连接参数。以下是一个示例配置:

development:
  adapter: oracle_enhanced
  database: xe
  username: user
  password: secret

其他连接参数如服务名、主机、端口等也可以在配置文件中指定。

3. 项目 API 使用文档

目前项目 API 使用文档未提供。用户可以通过阅读源代码和 GitHub 上的 Wiki 来获取更多使用信息。

4. 项目安装方式

项目的安装方式与安装指南中描述的步骤相同,主要通过 Gemfile 添加依赖并运行 bundle install 命令完成安装。如需使用特定版本的适配器,可以在 Gemfile 中指定相应的版本号。

登录后查看全文
热门项目推荐