### Home Classes Methods

### In Files

- lib/amalgalite/column.rb

### Parent

Object

### Methods

- ::new
- #auto_increment=
- #auto_increment?
- #has_default_value?
- #not_null_constraint=
- #not_null_constraint?
- #nullable?
- #primary_key=
- #primary_key?

### Files

- HISTORY.rdoc
- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- Amalgalite
- Amalgalite::Aggregate
- Amalgalite::Blob
- Amalgalite::Blob::Error
- Amalgalite::Boolean
- Amalgalite::BusyHandler
- Amalgalite::BusyTimeout
- Amalgalite::CSVTableImporter
- Amalgalite::Column
- Amalgalite::Database
- Amalgalite::Database::AggregateError
- Amalgalite::Database::BusyHandlerError
- Amalgalite::Database::FunctionError
- Amalgalite::Database::InvalidModeError
- Amalgalite::Database::ProgressHandlerError
- Amalgalite::Database::TransactionBehavior
- Amalgalite::Error
- Amalgalite::Function
- Amalgalite::Index
- Amalgalite::MemoryDatabase
- Amalgalite::Packer
- Amalgalite::Paths
- Amalgalite::ProfileSampler
- Amalgalite::ProfileTap
- Amalgalite::ProgressHandler
- Amalgalite::Requires
- Amalgalite::SQLite3
- Amalgalite::SQLite3::Constants
- Amalgalite::SQLite3::Constants::Config
- Amalgalite::SQLite3::Constants::DBStatus
- Amalgalite::SQLite3::Constants::DataType
- Amalgalite::SQLite3::Constants::Helpers
- Amalgalite::SQLite3::Constants::Open
- Amalgalite::SQLite3::Constants::ResultCode
- Amalgalite::SQLite3::Constants::StatementStatus
- Amalgalite::SQLite3::Constants::Status
- Amalgalite::SQLite3::Database
- Amalgalite::SQLite3::Database::DBStatus
- Amalgalite::SQLite3::Database::Function
- Amalgalite::SQLite3::Database::Stat
- Amalgalite::SQLite3::Stat
- Amalgalite::SQLite3::Status
- Amalgalite::SQLite3::Version
- Amalgalite::Schema
- Amalgalite::Statement
- Amalgalite::Table
- Amalgalite::Taps
- Amalgalite::Taps::IO
- Amalgalite::Taps::Stderr
- Amalgalite::Taps::Stdout
- Amalgalite::Taps::StringIO
- Amalgalite::TraceTap
- Amalgalite::TypeMap
- Amalgalite::TypeMaps
- Amalgalite::TypeMaps::DefaultMap
- Amalgalite::TypeMaps::StorageMap
- Amalgalite::TypeMaps::TextMap
- Amalgalite::Version
- Amalgalite::View
- Kernel
- Object

No matching classes.

# 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.