module Sequel::Access::DatabaseMethods
Constants
- DATABASE_ERROR_REGEXPS
Public Instance Methods
Source
# File lib/sequel/adapters/shared/access.rb 14 def database_type 15 :access 16 end
Source
Source
# File lib/sequel/adapters/shared/access.rb 31 def serial_primary_key_options 32 {:primary_key => true, :type=>:Counter} 33 end
Access
uses type Counter for an autoincrementing keys
Private Instance Methods
Source
# File lib/sequel/adapters/shared/access.rb 37 def alter_table_set_column_type_sql(table, op) 38 "ALTER COLUMN #{quote_identifier(op[:name])} #{type_literal(op)}" 39 end
Source
# File lib/sequel/adapters/shared/access.rb 63 def column_schema_integer_min_max_values(column) 64 return if /byte/i =~ column[:db_type] 65 super 66 end
Access’s Byte type will accept much larger values, even though it only stores 0-255. Do not set min/max values for the Byte type.
Calls superclass method
Source
# File lib/sequel/adapters/shared/access.rb 45 def create_table_as(name, ds, options) 46 raise(Error, "must provide dataset instance as value of create_table :as option on Access") unless ds.is_a?(Sequel::Dataset) 47 run(ds.into(name).sql) 48 end
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.
Source
# File lib/sequel/adapters/shared/access.rb 56 def database_error_regexps 57 DATABASE_ERROR_REGEXPS 58 end
Source
# File lib/sequel/adapters/shared/access.rb 68 def drop_index_sql(table, op) 69 "DROP INDEX #{quote_identifier(op[:name] || default_index_name(table, op[:columns]))} ON #{quote_schema_table(table)}" 70 end
Source
# File lib/sequel/adapters/shared/access.rb 74 def type_literal_generic_bignum_symbol(column) 75 :integer 76 end
Access
doesn’t have a 64-bit integer type, so use integer and hope the user isn’t using more than 32 bits.
Source
# File lib/sequel/adapters/shared/access.rb 84 def type_literal_generic_file(column) 85 :image 86 end
Access
uses image type for blobs
Source
# File lib/sequel/adapters/shared/access.rb 79 def type_literal_generic_trueclass(column) 80 :bit 81 end
Access
doesn’t have a true boolean class, so it uses bit