Permalink
Browse files

Merge sequel_core directory into sequel directory

This is the first half of the merge, the merge of sequel_model into
sequel will come next.  I'm going this because it makes things
cleaner.  I've wanted to do this for a while, but it wasn't worth
the minor breakage.  Now that Sequel 3.0 is coming soon, it seemed
like a good time.

To make life easier and to allow for more flexibility, I'm adding
a Sequel.require method that simplifies requiring multiple files.
It also only loads files in the same directory or a subdirectory
of the directory containing lib/sequel/core.rb.  Sequel used to do
this many moons ago, and I removed it to give users more flexibility
to override stuff.  I've come to the conclusion that removing it
caused more problems than it solved.  There have been a couple of
cases during the recent refactoring where I got obscure errors
because I deleted a file but still had it required somewhere, and it
loaded a file in a previous gem.  If people want to customize sequel,
they should fork the repository or unpack the gem to make their
modifications.

This requires simple changes to all adapters.  I hope I didn't screw
anything up, but it should be easy to fix if I did.

This also fixes a reference to Schema::SQL in the shared MySQL
adapter.
  • Loading branch information...
1 parent d6db9f7 commit 88e9e93712a9906a4aa8ec86782d62681a860a60 @jeremyevans jeremyevans committed Mar 13, 2009
Showing with 250 additions and 255 deletions.
  1. +2 −2 Rakefile
  2. +2 −2 lib/{sequel_core → sequel}/adapters/ado.rb
  3. 0 lib/{sequel_core → sequel}/adapters/db2.rb
  4. 0 lib/{sequel_core → sequel}/adapters/dbi.rb
  5. +3 −3 lib/{sequel_core → sequel}/adapters/do.rb
  6. +1 −1 lib/{sequel_core → sequel}/adapters/do/mysql.rb
  7. +1 −1 lib/{sequel_core → sequel}/adapters/do/postgres.rb
  8. +1 −1 lib/{sequel_core → sequel}/adapters/do/sqlite.rb
  9. +1 −1 lib/{sequel_core → sequel}/adapters/firebird.rb
  10. +1 −1 lib/{sequel_core → sequel}/adapters/informix.rb
  11. +7 −7 lib/{sequel_core → sequel}/adapters/jdbc.rb
  12. +1 −2 lib/{sequel_core → sequel}/adapters/jdbc/h2.rb
  13. +1 −1 lib/{sequel_core → sequel}/adapters/jdbc/mysql.rb
  14. +1 −1 lib/{sequel_core → sequel}/adapters/jdbc/oracle.rb
  15. +1 −1 lib/{sequel_core → sequel}/adapters/jdbc/postgresql.rb
  16. +1 −1 lib/{sequel_core → sequel}/adapters/jdbc/sqlite.rb
  17. +1 −2 lib/{sequel_core → sequel}/adapters/mysql.rb
  18. +2 −2 lib/{sequel_core → sequel}/adapters/odbc.rb
  19. 0 lib/{sequel_core → sequel}/adapters/openbase.rb
  20. +1 −1 lib/{sequel_core → sequel}/adapters/oracle.rb
  21. +1 −1 lib/{sequel_core → sequel}/adapters/postgres.rb
  22. +1 −1 lib/{sequel_core → sequel}/adapters/shared/mssql.rb
  23. +4 −6 lib/{sequel_core → sequel}/adapters/shared/mysql.rb
  24. +1 −2 lib/{sequel_core → sequel}/adapters/shared/oracle.rb
  25. 0 lib/{sequel_core → sequel}/adapters/shared/postgres.rb
  26. +1 −2 lib/{sequel_core → sequel}/adapters/shared/progress.rb
  27. +1 −1 lib/{sequel_core → sequel}/adapters/shared/sqlite.rb
  28. +1 −1 lib/{sequel_core → sequel}/adapters/sqlite.rb
  29. 0 lib/{sequel_core → sequel}/adapters/utils/date_format.rb
  30. 0 lib/{sequel_core → sequel}/adapters/utils/stored_procedures.rb
  31. 0 lib/{sequel_core → sequel}/adapters/utils/unsupported.rb
  32. 0 lib/{sequel_core → sequel}/connection_pool.rb
  33. +204 −0 lib/sequel/core.rb
  34. 0 lib/{sequel_core → sequel}/core_ext.rb
  35. 0 lib/{sequel_core → sequel}/core_sql.rb
  36. +1 −3 lib/{sequel_core → sequel}/database.rb
  37. 0 lib/{sequel_core → sequel}/database/schema_generator.rb
  38. 0 lib/{sequel_core → sequel}/database/schema_methods.rb
  39. 0 lib/{sequel_core → sequel}/database/schema_sql.rb
  40. +0 −4 lib/{sequel_core → sequel}/dataset.rb
  41. 0 lib/{sequel_core → sequel}/dataset/convenience.rb
  42. 0 lib/{sequel_core → sequel}/dataset/prepared_statements.rb
  43. 0 lib/{sequel_core → sequel}/dataset/sql.rb
  44. 0 lib/{sequel_core → sequel}/deprecated.rb
  45. 0 lib/{sequel_core → sequel}/exceptions.rb
  46. 0 lib/{sequel_core → sequel}/metaprogramming.rb
  47. 0 lib/{sequel_core → sequel}/migration.rb
  48. 0 lib/{sequel_core → sequel}/object_graph.rb
  49. 0 lib/{sequel_core → sequel}/sql.rb
  50. 0 lib/{sequel_core → sequel}/version.rb
  51. +1 −198 lib/sequel_core.rb
  52. +1 −1 lib/sequel_model.rb
  53. +1 −1 spec/adapters/spec_helper.rb
  54. +1 −1 spec/extensions/spec_helper.rb
  55. +1 −1 spec/sequel_core/database_spec.rb
  56. +1 −1 spec/sequel_core/spec_helper.rb
  57. +1 −1 spec/sequel_model/spec_helper.rb
View
@@ -8,7 +8,7 @@ rescue LoadError
require "rake/rdoctask"
end
require "fileutils"
-require "lib/sequel_core/version"
+require "lib/sequel/version"
include FileUtils
@@ -61,7 +61,7 @@ task :uninstall=>[:clean] do
sh %{sudo gem uninstall #{NAME}}
end
-desc "Upload sequel and sequel_core gems to rubyforge"
+desc "Upload sequel gem to rubyforge"
task :release=>[:package] do
sh %{rubyforge login}
sh %{rubyforge add_release sequel #{NAME} #{VERS} pkg/#{NAME}-#{VERS}.tgz}
@@ -1,4 +1,4 @@
-require 'sequel_core/adapters/utils/date_format'
+Sequel.require 'adapters/utils/date_format'
require 'win32ole'
module Sequel
@@ -20,7 +20,7 @@ def initialize(opts)
opts[:driver] ||= 'SQL Server'
case opts[:driver]
when 'SQL Server'
- require 'sequel_core/adapters/shared/mssql'
+ Sequel.require 'adapters/shared/mssql'
extend Sequel::MSSQL::DatabaseMethods
end
end
File renamed without changes.
File renamed without changes.
@@ -15,19 +15,19 @@ module DataObjects
# given database object so it supports the correct database type.
DATABASE_SETUP = {:postgres=>proc do |db|
require 'do_postgres'
- require 'sequel_core/adapters/do/postgres'
+ Sequel.require 'adapters/do/postgres'
db.converted_exceptions << PostgresError
db.extend(Sequel::DataObjects::Postgres::DatabaseMethods)
end,
:mysql=>proc do |db|
require 'do_mysql'
- require 'sequel_core/adapters/do/mysql'
+ Sequel.require 'adapters/do/mysql'
db.converted_exceptions << MysqlError
db.extend(Sequel::DataObjects::MySQL::DatabaseMethods)
end,
:sqlite3=>proc do |db|
require 'do_sqlite3'
- require 'sequel_core/adapters/do/sqlite'
+ Sequel.require 'adapters/do/sqlite'
db.converted_exceptions << Sqlite3Error
db.extend(Sequel::DataObjects::SQLite::DatabaseMethods)
end
@@ -1,4 +1,4 @@
-require 'sequel_core/adapters/shared/mysql'
+Sequel.require 'adapters/shared/mysql'
module Sequel
module DataObjects
@@ -1,4 +1,4 @@
-require 'sequel_core/adapters/shared/postgres'
+Sequel.require 'adapters/shared/postgres'
module Sequel
Postgres::CONVERTED_EXCEPTIONS << PostgresError
@@ -1,4 +1,4 @@
-require 'sequel_core/adapters/shared/sqlite'
+Sequel.require 'adapters/shared/sqlite'
module Sequel
module DataObjects
@@ -1,5 +1,5 @@
require 'fb'
-require 'sequel_core/adapters/utils/unsupported'
+Sequel.require 'adapters/utils/unsupported'
module Sequel
# The Sequel Firebird adapter requires the ruby fb driver located at
@@ -1,4 +1,4 @@
-require 'sequel_core/adapters/utils/unsupported'
+Sequel.require 'adapters/utils/unsupported'
require 'informix'
module Sequel
@@ -1,5 +1,5 @@
require 'java'
-require 'sequel_core/adapters/utils/stored_procedures'
+Sequel.require 'adapters/utils/stored_procedures'
module Sequel
# Houses Sequel's JDBC support when running on JRuby.
@@ -35,35 +35,35 @@ module JavaSQL
# Contains procs keyed on sub adapter type that extend the
# given database object so it supports the correct database type.
DATABASE_SETUP = {:postgresql=>proc do |db|
- require 'sequel_core/adapters/jdbc/postgresql'
+ Sequel.require 'adapters/jdbc/postgresql'
db.extend(Sequel::JDBC::Postgres::DatabaseMethods)
JDBC.load_gem('postgres')
org.postgresql.Driver
end,
:mysql=>proc do |db|
- require 'sequel_core/adapters/jdbc/mysql'
+ Sequel.require 'adapters/jdbc/mysql'
db.extend(Sequel::JDBC::MySQL::DatabaseMethods)
JDBC.load_gem('mysql')
com.mysql.jdbc.Driver
end,
:sqlite=>proc do |db|
- require 'sequel_core/adapters/jdbc/sqlite'
+ Sequel.require 'adapters/jdbc/sqlite'
db.extend(Sequel::JDBC::SQLite::DatabaseMethods)
JDBC.load_gem('sqlite3')
org.sqlite.JDBC
end,
:oracle=>proc do |db|
- require 'sequel_core/adapters/jdbc/oracle'
+ Sequel.require 'adapters/jdbc/oracle'
db.extend(Sequel::JDBC::Oracle::DatabaseMethods)
Java::oracle.jdbc.driver.OracleDriver
end,
:sqlserver=>proc do |db|
- require 'sequel_core/adapters/shared/mssql'
+ Sequel.require 'adapters/shared/mssql'
db.extend(Sequel::MSSQL::DatabaseMethods)
com.microsoft.sqlserver.jdbc.SQLServerDriver
end,
:h2=>proc do |db|
- require 'sequel_core/adapters/jdbc/h2'
+ Sequel.require 'adapters/jdbc/h2'
db.extend(Sequel::JDBC::H2::DatabaseMethods)
JDBC.load_gem('h2')
org.h2.Driver
@@ -1,5 +1,4 @@
-require 'sequel_core/adapters/utils/date_format'
-require 'sequel_core/adapters/utils/unsupported'
+Sequel.require %w'date_format unsupported', 'adapters/utils'
module Sequel
module JDBC
@@ -1,4 +1,4 @@
-require 'sequel_core/adapters/shared/mysql'
+Sequel.require 'adapters/shared/mysql'
module Sequel
module JDBC
@@ -1,4 +1,4 @@
-require 'sequel_core/adapters/shared/oracle'
+Sequel.require 'adapters/shared/oracle'
module Sequel
module JDBC
@@ -1,4 +1,4 @@
-require 'sequel_core/adapters/shared/postgres'
+Sequel.require 'adapters/shared/postgres'
module Sequel
Postgres::CONVERTED_EXCEPTIONS << NativeException
@@ -1,4 +1,4 @@
-require 'sequel_core/adapters/shared/sqlite'
+Sequel.require 'adapters/shared/sqlite'
module Sequel
module JDBC
@@ -1,6 +1,5 @@
require 'mysql'
-require 'sequel_core/adapters/shared/mysql'
-require 'sequel_core/adapters/utils/stored_procedures'
+Sequel.require %w'shared/mysql utils/stored_procedures', 'adapters'
module Sequel
# Module for holding all MySQL-related classes and modules for Sequel.
@@ -12,10 +12,10 @@ def initialize(opts)
super(opts)
case opts[:db_type]
when 'mssql'
- require 'sequel_core/adapters/shared/mssql'
+ Sequel.require 'adapters/shared/mssql'
extend Sequel::MSSQL::DatabaseMethods
when 'progress'
- require 'sequel_core/adapters/shared/progress'
+ Sequel.require 'adapters/shared/progress'
extend Sequel::Progress::DatabaseMethods
end
end
@@ -1,5 +1,5 @@
require 'oci8'
-require 'sequel_core/adapters/shared/oracle'
+Sequel.require 'adapters/shared/oracle'
module Sequel
module Oracle
@@ -1,4 +1,4 @@
-require 'sequel_core/adapters/shared/postgres'
+Sequel.require 'adapters/shared/postgres'
begin
require 'pg'
@@ -1,4 +1,4 @@
-require 'sequel_core/adapters/utils/unsupported'
+Sequel.require 'adapters/utils/unsupported'
module Sequel
module MSSQL
@@ -1,11 +1,9 @@
-require 'sequel_core/adapters/utils/unsupported'
+Sequel.require 'adapters/utils/unsupported'
module Sequel
- module Schema
- module SQL
- # Keep default column_references_sql for add_foreign_key support
- alias default_column_references_sql column_references_sql
- end
+ class Database
+ # Keep default column_references_sql for add_foreign_key support
+ alias default_column_references_sql column_references_sql
end
module MySQL
class << self
@@ -1,5 +1,4 @@
-require 'sequel_core/adapters/utils/date_format'
-require 'sequel_core/adapters/utils/unsupported'
+Sequel.require %w'date_format unsupported', 'adapters/utils'
module Sequel
module Oracle
@@ -1,5 +1,4 @@
-require 'sequel_core/adapters/utils/date_format'
-require 'sequel_core/adapters/utils/unsupported'
+Sequel.require %w'date_format unsupported', 'adapters/utils'
module Sequel
module Progress
@@ -1,4 +1,4 @@
-require 'sequel_core/adapters/utils/unsupported'
+Sequel.require 'adapters/utils/unsupported'
module Sequel
module SQLite
@@ -1,5 +1,5 @@
require 'sqlite3'
-require 'sequel_core/adapters/shared/sqlite'
+Sequel.require 'adapters/shared/sqlite'
module Sequel
# Top level module for holding all SQLite-related modules and classes
File renamed without changes.
Oops, something went wrong.

0 comments on commit 88e9e93

Please sign in to comment.