Module: Sequel::DataObjects

Defined in:
lib/sequel/adapters/do.rb,
lib/sequel/adapters/do/mysql.rb,
lib/sequel/adapters/do/sqlite.rb,
lib/sequel/adapters/do/postgres.rb

Overview

Module holding the DataObjects support for Sequel. DataObjects is a ruby library with a standard API for accessing databases.

The DataObjects adapter currently supports PostgreSQL, MySQL, and SQLite:

  • Sequel.connect(‘do:sqlite3::memory:’)

  • Sequel.connect(‘do:postgres://user:password@host/database’)

  • Sequel.connect(‘do:mysql://user:password@host/database’)

Defined Under Namespace

Modules: MySQL, Postgres, SQLite Classes: Database, Dataset

Constant Summary collapse

DATABASE_SETUP =

Contains procs keyed on sub adapter type that extend the given database object so it supports the correct database type.

{:postgres=>proc do |db|
    require 'do_postgres'
    Sequel.require 'adapters/do/postgres'
    db.extend(Sequel::DataObjects::Postgres::DatabaseMethods)
    db.extend_datasets Sequel::Postgres::DatasetMethods
  end,
  :mysql=>proc do |db|
    require 'do_mysql'
    Sequel.require 'adapters/do/mysql'
    db.extend(Sequel::DataObjects::MySQL::DatabaseMethods)
    db.dataset_class = Sequel::DataObjects::MySQL::Dataset
  end,
  :sqlite3=>proc do |db|
    require 'do_sqlite3'
    Sequel.require 'adapters/do/sqlite'
    db.extend(Sequel::DataObjects::SQLite::DatabaseMethods)
    db.extend_datasets Sequel::SQLite::DatasetMethods
    db.set_integer_booleans
  end
}