Parent

Class/Module Index [+]

Quicksearch

Amalgalite::Column

a class representing the meta information about an SQLite column, this class serves both for general Schema level information, and for result set information from a SELECT query.

Attributes

collation_sequence_name[RW]

the collation sequence name of the column

db[RW]

the database name this column belongs to

declared_data_type[RW]

the declared data type of the column in the original sql that created the column

default_value[RW]

the default value of the column. This may not have a value and that either means that there is no default value, or one could not be determined.

name[RW]

the column name

order[RW]

The index (starting with 0) of this column in the table definition or result set

schema[RW]

the schema object this column is associated with

table[RW]

the table to which this column belongs

Public Class Methods

new( db, table, name, order) click to toggle source

Create a column with its name and associated table

# File lib/amalgalite/column.rb, line 48
def initialize( db, table, name, order)
  @db                 = db
  @name               = name
  @table              = table
  @order              = Float(order).to_i
  @declared_data_type = nil
  @default_value      = nil
end

Public Instance Methods

auto_increment=( other ) click to toggle source

set whether or not the column is auto increment

# File lib/amalgalite/column.rb, line 88
def auto_increment=( other )
  @auto_increment = Boolean.to_bool( other )
end
auto_increment?() click to toggle source

true if the column is auto increment

# File lib/amalgalite/column.rb, line 93
def auto_increment?
  @auto_increment
end
has_default_value?() click to toggle source

true if the column has a default value

# File lib/amalgalite/column.rb, line 58
def has_default_value?
  not default_value.nil?
end
not_null_constraint=( other ) click to toggle source

set whether or not the column has a not null constraint

# File lib/amalgalite/column.rb, line 68
def not_null_constraint=( other )
  @not_null_constraint = Boolean.to_bool( other )
end
not_null_constraint?() click to toggle source

true if the column as a NOT NULL constraint

# File lib/amalgalite/column.rb, line 73
def not_null_constraint?
  @not_null_constraint
end
nullable?() click to toggle source

true if the column may have a NULL value

# File lib/amalgalite/column.rb, line 63
def nullable?
  @not_null_constraint == false
end
primary_key=( other ) click to toggle source

set whether or not the column is a primary key column

# File lib/amalgalite/column.rb, line 78
def primary_key=( other )
  @primary_key = Boolean.to_bool( other )
end
primary_key?() click to toggle source

true if the column is a primary key column

# File lib/amalgalite/column.rb, line 83
def primary_key?
  @primary_key
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.