module Sequel::Access::DatabaseMethods
Constants
- DATABASE_ERROR_REGEXPS
Public Instance Methods
database_type()
click to toggle source
Access uses type :access as the #database_type
# File lib/sequel/adapters/shared/access.rb, line 9 def database_type :access end
rename_table(from_table, to_table)
click to toggle source
serial_primary_key_options()
click to toggle source
Access uses type Counter for an autoincrementing keys
# File lib/sequel/adapters/shared/access.rb, line 26 def serial_primary_key_options {:primary_key => true, :type=>:Counter} end
Private Instance Methods
alter_table_op_sql(table, op)
click to toggle source
Calls superclass method
# File lib/sequel/adapters/shared/access.rb, line 32 def alter_table_op_sql(table, op) case op[:op] when :set_column_type "ALTER COLUMN #{quote_identifier(op[:name])} #{type_literal(op)}" else super end end
create_table_as(name, ds, options)
click to toggle source
Access doesn't support CREATE TABLE AS, it only supports SELECT INTO. Emulating CREATE TABLE AS using SELECT INTO is only possible if a dataset is given as the argument, it can't work with a string, so raise an Error if a string is given.
# File lib/sequel/adapters/shared/access.rb, line 45 def create_table_as(name, ds, options) raise(Error, "must provide dataset instance as value of create_table :as option on Access") unless ds.is_a?(Sequel::Dataset) run(ds.into(name).sql) end
database_error_regexps()
click to toggle source
# File lib/sequel/adapters/shared/access.rb, line 56 def database_error_regexps DATABASE_ERROR_REGEXPS end
drop_index_sql(table, op)
click to toggle source
The SQL to drop an index for the table.
# File lib/sequel/adapters/shared/access.rb, line 61 def drop_index_sql(table, op) "DROP INDEX #{quote_identifier(op[:name] || default_index_name(table, op[:columns]))} ON #{quote_schema_table(table)}" end
identifier_input_method_default()
click to toggle source
# File lib/sequel/adapters/shared/access.rb, line 65 def identifier_input_method_default nil end
identifier_output_method_default()
click to toggle source
# File lib/sequel/adapters/shared/access.rb, line 69 def identifier_output_method_default nil end
type_literal_generic_bignum(column)
click to toggle source
Access doesn't have a 64-bit integer type, so use integer and hope the user isn't using more than 32 bits.
# File lib/sequel/adapters/shared/access.rb, line 75 def type_literal_generic_bignum(column) :integer end
type_literal_generic_file(column)
click to toggle source
Access uses image type for blobs
# File lib/sequel/adapters/shared/access.rb, line 85 def type_literal_generic_file(column) :image end
type_literal_generic_trueclass(column)
click to toggle source
Access doesn't have a true boolean class, so it uses bit
# File lib/sequel/adapters/shared/access.rb, line 80 def type_literal_generic_trueclass(column) :bit end