forked from localytics/odbc_adapter
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from localytics/null-adapter
Null adapter
- Loading branch information
Showing
3 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module ODBCAdapter | ||
module Adapters | ||
# A default adapter used for databases that are no explicitly listed in the | ||
# registry. This allows for minimal support for DBMSs for which we don't | ||
# have an explicit adapter. | ||
class NullODBCAdapter < ActiveRecord::ConnectionAdapters::ODBCAdapter | ||
class BindSubstitution < Arel::Visitors::ToSql | ||
include Arel::Visitors::BindVisitor | ||
end | ||
|
||
# Using a BindVisitor so that the SQL string gets substituted before it is | ||
# sent to the DBMS (to attempt to get as much coverage as possible for | ||
# DBMSs we don't support). | ||
def arel_visitor | ||
BindSubstitution.new(self) | ||
end | ||
|
||
# Explicitly turning off prepared_statements in the null adapter because | ||
# there isn't really a standard on which substitution character to use. | ||
def prepared_statements | ||
false | ||
end | ||
|
||
# Turning off support for migrations because there is no information to | ||
# go off of for what syntax the DBMS will expect. | ||
def supports_migrations? | ||
false | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters