Sha256: 10ef5b6206f92712d10a50f09fe6d4a27aa40c7295f679b63d3b58597e12b77a

Contents?: true

Size: 1.35 KB

Versions: 42

Compression:

Stored size: 1.35 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

require 'sequel'

# This file is intended to define the database connection and schema for all of
# the Sequel multiverse tests.
#
# DO NOT require newrelic_rpm here. Some of the tests rely on the timing of
# when New Relic gets pulled in.
if !defined?(DB)
  def jruby?
    defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
  end

  def create_tables(db)
    db.create_table( :authors ) do
      primary_key :id
      string :name
      string :login
    end

    db.create_table( :posts ) do
      primary_key :id
      string :title
      string :content
      time :created_at
    end

    db.create_table( :users ) do
      primary_key :uid
      string :login
      string :firstname
      string :lastname
    end
  end

  # Use an in-memory SQLite database
  if (jruby?)
    DB = Sequel.connect('jdbc:sqlite::memory:')
  else
    DB = Sequel.sqlite
  end

  create_tables(DB)

  class Author < Sequel::Model; end
  class Post < Sequel::Model; end
  class User < Sequel::Model; end

  # Version 4.0 of Sequel moved update_except off to a plugin
  # So we can test that we still instrument it, it's got to be included
  if defined?(Sequel::MAJOR) && Sequel::MAJOR >= 4
    Sequel::Model.plugin :blacklist_security
  end
end

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
newrelic_rpm-3.18.1.330 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.18.0.329 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.17.2.327 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.17.1.326 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.17.0.325 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.16.3.323 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.16.2.321 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.16.1.320 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.16.0.318 test/multiverse/suites/sequel/database.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.2.317/test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.15.2.317 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.15.1.316 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.15.0.314 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.14.3.313 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.14.2.312 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.14.1.311 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.14.0.305 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.13.2.302 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.13.1.300 test/multiverse/suites/sequel/database.rb
newrelic_rpm-3.13.0.299 test/multiverse/suites/sequel/database.rb